Doubts regarding /Documents/:record/file/:field POST endpoint

Can anyone please tell how to hit /Documents/:record/file/:field POST endpoint using Postman?

It uses following payload scheme:

{
   "format":"sugar-html-json",
   "delete_if_fails":true,
   "oauth_token":"43b6b327-cc70-c301-3299-512ffb99ad97",
   "<attachment field>":"@\/path\/to\/ExampleDocument.txt"
}

I am not able to resolve the <attachment field> in the above payload.

Parents Reply
  • Hello Andre,

    I tried the way you suggested.

    It is working fine when I first give the json payload and then pass the file in the form data, but if I construct the request with firstly passing file in form data and then passing the json, I am getting attachment missing error.

    Also, Is this endpoint accepts two media types (application/json and form-data) simultaneously in one request?

    One more thing is that this request is working fine even if I just provide the file in form-data and no json payload. Any idea why so?

    Thanks

Children