Forum Discussion

KhurramAR's avatar
KhurramAR
Experienced User
4 years ago
Solved

What's the best way to get a UID of newly created resource via POST

I am wondering what's the best way to get the UID of a newly created Contact or any other resource via POST request. The response does not contain anything. Not even an identifier of the newly created resource. Although there is a "Location" header in the response that contains a full URL of the resource which I assume to be parsed and get the UID from the end. Is it the only thing I can do? or there is anything else?

 

Regards,

  • Hi There, 

     

    Thanks for reaching out, If you pass ?returnBody=true in your query the API should return in the body. 

     

    The other option like you mentioned - is if the header of the response is for a 200 or 201  you can use the location URL to pull the full endpoint. 

1 Reply

Replies have been turned off for this discussion
  • Hi There, 

     

    Thanks for reaching out, If you pass ?returnBody=true in your query the API should return in the body. 

     

    The other option like you mentioned - is if the header of the response is for a 200 or 201  you can use the location URL to pull the full endpoint. 

Looking for something else?

Search the Community Forum for answers or find your topic and get the conversation started!

Community home

Learn:

 

Level up your skills using MYOB software.

 

Find help guides and technical solutions for all MYOB products here

Explore video tutorials for our software at the MYOB Academy here

 

Dig into MYOB Academy for free courses, learning paths and live events to help build your business with MYOB.