KB

Sign In

OneDesk Public API with Postman




OneDesk’s public API can be used to push or pull information from your OneDesk account. This allows you to connect and synchronize the data between OneDesk and a third-party application without going through the interface.


Available on the Enterprise Plan.


See below for some examples of using OneDesk’s API using the Postman API platform.


Getting started


First, you must generate an API key by creating an API user inside your OneDesk account in Administration > Integrations > API.


You can create as many API users as you would like. Each API user will count as a paid user license. Only share the generated API key with trusted sources. The API key is what will be used to authorize your API calls.



Simple GET - Only authorization header required


We can retrieve our organization’s profile and policy information with just our generated API key using GET (https://app.onedesk.com/rest/public/organization/profileAndPolicy)


1.Access OneDesk’s API documentation and locate the “get organization profile and policy” call.

2.Copy its URL and note the required parameters.

For this call, only your authorization (API key) is required. Note that the API key must be added as a Header parameter titled “OD-Public-API-Key”



3.In Postman, create a new HTTP GET.



4.Paste in the URL where prompted in the GET request.

5.Add OD-Public-API-Key as a parameter in your “Headers” section and add your API key.



6.Press “send” and the call will be executed and display in the response window.



GET with additional required parameters


Let’s use GET (https://app.onedesk.com/rest/public/items/externalId/{externalId} )to update an item in our OneDesk account based on its external id.


1.Access OneDesk’s API documentation and locate the “update item by external id” call.

2.Copy its URL and note the required parameters.

  1. For this call, authorization via the API key using OD-Public-API-Key as a header parameter is required, in addition to the “externalId” parameter.

3.In Postman, create a new HTTP GET.



4.Paste in the URL where prompted in the GET request.

5.Add OD-Public-API-Key as a parameter in your “Headers” section and add your API key.



6.Now, you can replace {externalId} in the URL with the desired external id and select “Send” to complete the call.

- You can locate an item’s external id by running a similar call to get this item's information using the item's internal ID (the ID shown in your main OneDesk application), such as /rest/public/items/id/{id}



7.Alternatively, you can add the external id as a path variable to your “Params” section in postman by replacing {externalId} with :externalId

  1. You can then enter the external id in the “value” column of the path variable section and send the call without modifying the URL further.




POST using OneDesk’s API


In addition to GET requests, OneDesk’s API makes use of POSTs. Let’s use POST (https://app.onedesk.com/rest/public/items/ ) to create a ticket into our OneDesk account.


1.Access OneDesk’s API documentation and locate the “create work item” call.

2.Copy its URL and note the required parameters.

  1. For this call, authorization via the API key using OD-Public-API-Key as a header parameter is required.
  2. Additionally, your request body must be application/json, and the name parameter is required.

3.In Postman, create a new HTTP POST.



4.Paste in the URL where prompted for the POST.

5.Add OD-Public-API-Key as a parameter in your “Headers” section and add your API key.



6.Switch to the “Body” tab and change the format to raw JSON as this is the required schema noted in the documentation.




7.Now you can fill out the body of your request. See the API documentation for a sample request. Only the item name is required.



8.Send the request when done. After it runs successfully, you can check the created item inside OneDesk.




Related articles