Thank you Emile,
I had tried that, just forgot to put it in the original post, but i get the following error when doing it that way:
{
"Errors": [
{
"Name": "InternalError",
"Message": "An exception was thrown that was not handled correctly. If this situation persists please contact developers@myob.com for further assistance.",
"AdditionalDetails": null,
"ErrorCode": 20,
"Severity": "Error",
"LearnMore": null
}
],
"Information": "Warning, error messages have not been finalised in this release and may change"
I do get different messages if i play with the JSON layout, but still no joy getting it to work.
EDIT:
Sorry, thought i had better put all my workings in here as well.
If i set the BODY to be JSON like:
{
"OriginalFileName": "Invoice.pdf",
"FileBase64Content": "JVBERi0{{truncated for ease}}YNCg++"
}
I always get the InternalError as shown above.
I thought about playing with the JSON layout and tried:
{
"Attachment": [
{
"OriginalFileName": "Invoice.pdf",
"FileBase64Content": "JVBERi0{{truncated for ease}}YNCg++"
}
]
}
But then i get the below error (which may be a valid error as i dont know how MYOB wants the BODY laid out)
{
"Errors": [
{
"Name": "SerializationError",
"Message": null,
"AdditionalDetails": "Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'MYOB.AccountRight.API.Version2.Contracts.BillAttachmentData' because the type requires a JSON object (e.g. {\"name\":\"value\"}) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON object (e.g. {\"name\":\"value\"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\r\nPath 'Attachment', line 2, position 16.",
"ErrorCode": 50,
"Severity": "Error",
"LearnMore": null
}
],
"Information": "Warning, error messages have not been finalised in this release and may change"
}
Hoping the above helps.