Symptom
The following error message appears when trying to upload a .pdf file using Odata service in Postman from customer local folder.
"Property 'DocumentLink' at offset '248' is invalid"
Environment
SAP Cloud for Customer
Reproducing the Issue
1. Open postman.
2. Generate the x-csrf-token.
3. Use the "ServiceRequestAttachmentFolder" URL to POST
Ex.: https://my*****.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ServiceRequestCollection(%ParentObjectID%27)/ServiceRequestAttachmentFolder
4. Payload as example:
{
"ParentObjectID": "*********",
"ServiceRequestID": "3492",
"TypeCode": "10001",
"MimeType": "standard/attachment",
"Name": "Test SAP ticket .pdf",
"CategoryCode": "2",
"DocumentLink": "C:\Users\myuser\TEST\C4sTicketAPI.pdf"
}
Cause
This is a syntax issue.
The issue is related with the backslash "\" on DocumentLink.
Resolution
To solve the issue, you should use the slash "/" rather than backslash "\".
Example: "C:/Users/myuser/TEST/C4sTicketAPI.pdf"
Keywords
OData, DocumentLink, Error, Invalid, Property, POST, Postman, Upload, File, Local, Folder , KBA , LOD-CRM-INT-API , OData API (C4C Only) , How To