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

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
KhurramAR
Contributing User
12 Posts
Contributing User
Contributing User

12Posts

0Kudos

0Solutions

Solved: Go to Solution

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,

1 REPLY 1
Hannah_B
MYOB Moderator
142 Posts
MYOB Moderator
Australia
MYOB Moderator

142Posts

33Kudos

25Solutions

Accepted Solution Solved

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

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. 


Thanks,
@Hannah_B


MYOB API Specialist


MYOB API Support Centre|MYOB App Marketplace|MYOB AccountRight API Endpoint Doc's



Did my answer help?


Mark it as a Solution

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post