It looks like if I try to pass it as a string, K2 escapes it and makes it invalid.
So K2 is sending this payload:
{
"planId": "xg6smYH69E-B9P5uD2weqMgACzzz",
"bucketId": "OZQvBBqIJ0Gh8mN7FeUyHsgACzzz",
"title": "Testing not serialised",
"startDateTime": "20*personal details removed*",
"dueDateTime": "20*personal details removed*",
"assignments": "{
"730ccc49-f9*personal details removed*c*personal details removed*b4a-ed708f6dzzzz": {
"@odata.type": "#microsoft.graph.plannerAssignment",
"orderHint": "N9917 U2883!"
}
}"
}
instead of
{
"planId":"nq-kM0yo4Eylw9GDuTahTMgAEzzz",
"title":"Testing not serialised",
"startDateTime":"20*personal details removed*",
"dueDateTime":"20*personal details removed*",
"assignments":{"d7cfab7f-93c3-4030-aba6-3c3a29ee1zzz": {"@odata.type": "#microsoft.graph.plannerAssignment","orderHint": "N9917 U2883!" }}}
So unless I can somehow include it as an object, I wonder how I can stop K2 escaping the string.
If I call the Tasks -> CreateTask method with no serialization, it still converts this:
{
"planId": "xg6smYH69E-B9P5uD2weqMgACzzz",
"bucketId": "OZQvBBqIJ0Gh8mN7FeUyHsgACzzz",
"title": "Testing not serialised",
"startDateTime": "20*personal details removed*",
"dueDateTime": "20*personal details removed*",
"assignments":{
"730ccc49-f9*personal details removed*c*personal details removed*b4a-ed708f6d9zzz":
{"@odata.type":"#microsoft.graph.plannerAssignment","orderHint":"N9917 U2883!"}
}
}
to
{"planId":"xg6smYH69E-B9P5uD2weqMgACzzz","bucketId":"OZQvBBqIJ0Gh8mN7FeUyHsgACzzz","title":"Testing not serialised","startDateTime":"20*personal details removed*","dueDateTime":"20*personal details removed*","assignments":"{
"730ccc49-f9*personal details removed*c*personal details removed*b4a-ed708f6d9zzz": {
"@odata.type": "#microsoft.graph.plannerAssignment",
"orderHint": "N9917 U2883!"
}
}"}
Can you strip out the carriage returns before you serialize?
Thanks for the Reply Nigel.
Yes, unfortunately if the request is escaped at all it fails. I've tested it out in Postman.
Somehow I need K2 to not try to serialize it.
Thanks
Getting rid of the CR/LF, this is effectively what is sent and returned
{
"planId":"{{PlanId}}",
"title":"Testing not serialised",
"startDateTime":"20*personal details removed*",
"dueDateTime":"20*personal details removed*",
"assignments":"{"d7cfab7f-93c3-4030-aba6-3c3a29ee1zzz":{"@odata.type":"#microsoft.graph.plannerAssignment","orderHint":" !"}}"
}
This is what gets returned
{
"error": {
"code": "BadRequest",
"message": "Property assignments in payload has a value that does not match schema.",
"innerError": {
"date": "20*personal details removed*T01:52:22",
"request-id": "a6716bdf-05*personal details removed*ba-92ee-c922d225a09c"
}
}
}