Forum Discussion

ripglobal's avatar
ripglobal
Contributing User
5 years ago

Get UID of created object back from AccountRight API in POST

When I POST to the Essentials v0/v1 endpoints to (say) create a purchase bill or journal entry, there is a 200 OK response with a JSON body that lets me get the UID of the newly-created object. This ...
  • Mike_James's avatar
    5 years ago

    Hi ripglobal , the header (roughheader) of a successful post should look something like the below, the UID is the last 36 characters of line 5:

     

    HTTP/1.1 201 Created
    Cache-Control: no-cache
    Date: Sat, 28 Dec 2019 01:26:18 GMT
    Expires: -1
    Location: https://ar1.api.myob.com/accountright/<fileid>/Purchase/Bill/Service/97bf786d-bedd-4850-8319-02e35dc42d05
    Pragma: no-cache
    Server: Microsoft-IIS/10.0
    X-AspNet-Version: 4.0.30319
    X-Mashery-Message-ID: 71cb432a-ac0d-40bb-8a85-9e2e0e613394
    X-Mashery-Responder: prod-j-worker-ap-southeast-2b-39.mashery.com
    x-myobapi-elapsed: 1134
    x-myobapi-requestid: 84863e72-8848-4c95-8e74-749d040eb05e
    X-Powered-By: ASP.NET
    Content-Length: 0
    Connection: Close

     

    I hope this is helpful.