Forum Discussion

Miles Maddox's avatar
Miles Maddox
New Member
9 years ago

Service Desk API - Create release instruction

I've been passively putting together a client library for the Service Desk API. I've only created the methods as I needed them so it's not at all 100% complete. My next need is to create a release with component/instructions. I'm having issues when attempting to create the "release instructions" portion of a release but am getting an empty response.

As per the documentation, I'm sending a POST request to /v1/releases/<release id>/instructions.json with the below payload returns an empty response. Any ideas what the correct URI/payload might be? 
{"instruction":{"note":"test"}}
Note: the release already exists and has an empty "release instruction" field.
  • SaschaZ's avatar
    SaschaZ
    Retired GoTo Contributor
    Hi Miles,

    I asked engineering to give me an example of the proper syntax to use and here's what I received:

    http://localhost:8080/external_api/v1/releases/13.json -d '{ "release" : { "release_instruction" : "note" }}’

    Where 13 is the reference_num and “note” is the value for the note.

    Is this what you were looking for?
  • Thanks for looking into this. I'm executing this but receiving 406 Not Acceptable response.  Here's my actual request in curl:

    curl -X POST -H "Authorization: Basic REDACTED==" -H "Content-Type: application/json" -d '{ "release" : { "release_instruction" : "note" }}' "https://deskapi.gotoassist.com/external_api/v1/releases/1000.json"

    Where 1000 is the ID of the release I'm attempting to update.
  • SaschaZ's avatar
    SaschaZ
    Retired GoTo Contributor
    Hi Miles, 

    If you're looking to update, you need to use "PUT" and not "POST", also you need to include "Accept: application/json" to indicate the type of information you're accepting on the response which would explain why you're getting the 406 error.

    The correct syntax should be something like: 
    curl -u -X PUT -H "Authorization: Basic REDACTED==" -H "Content-Type: application/json” -H "Accept: application/json” -d '{ "release" : { "release_instruction" : "works" }}’ "http://deskapi.gotoassist.com/external_api/v1/releases/1000.json”

    Hope that works!