How can we help?

How to Use Postman for Custom Integrations

Tony Chong Flannery
Tony Chong Flannery
  • Updated

Steps in Torii

Create an API Key

  1. Log in to Torii as an admin.

  2. Go to Settings > API Access, then click Generate API Key.
    mceclip0.png

  3. Select Full Access (default), then click Generate key.
    mceclip1.png

  4. Save the key in a password manager/secrets vault since Torii will not display it again.

Create an Application Account ID

  1. In Torii, go to Integrations.

  2. Find Add Custom Integration (search or scroll to the bottom of the list), then click the tile.
    mceclip2.png

  3. You can connect your custom integration to an app already in Torii’s catalog or create a new one. Note that you can select an app that you haven’t integrated OR one that’s already connected via native integration.

  4. Click Add Integration.

  5. Torii will show you the unique Application Account ID for your new custom integration. Unlike an API key, you can retrieve (and copy) this Application Account ID at any time from the Integrations page by hovering over your custom integration’s tile.
    mceclip3.png

Steps in Postman

Get File Upload Parameters from Torii’s API

  1. Select GET from the HTTP method dropdown and enter https://api.toriihq.com/beta/files/url?name=my_file.json&type=customIntegrationData as the URL.
    mceclip4.png
    Note: you can change the filename in the path from my_file.json to whatever you’d prefer. Alternatively, you can use https://api.toriihq.com/beta/files/url as the URL and specify a name and type under “Params”:
    mceclip2.png

  2. In the “Authorization” tab, select Bearer Token and then paste your Torii API Key in the “Token” field.mceclip5.png

  3. Click Send.

  4. The response body will return key-value pairs for “url” and “filePath.” Both will be used in subsequent steps.
    mceclip6.png

Upload a JSON File

  1. Create or export a JSON users file that matches the schema and example file in our API documentation.
  2. Open a new Postman tab, select PUT from the HTTP method dropdown, and enter the URL returned from the previous GET command.
  3. Click the “Body” tab, select raw, and paste your JSON users file. Make sure to select JSON from the data type dropdown.
    mceclip7.png

  4. Click the “Headers” tab and find the “Content-Type” key. It will have a default value of application/json. Uncheck the box to disable the header.
    mceclip8.png

  5. Find a blank header “Key” cell at the bottom of the list and start typing “Content” to find Content-Type. Select it from the dropdown, then enter customIntegrationData in the corresponding “Value” cell.
    mceclip9.png
  6. Your final list of parameters (”Params”) should look like this
    mceclip3.png

  7. Click Send to upload your JSON file to Torii.

Get Your File ID

  1. Open a new Postman tab, select POST from the HTTP method dropdown, and enter the URL https://api.toriihq.com/beta/files.
  2. Add your API Key to the “Authorization” tab as you did previously.
  3. In the “Body” tab, enter two key-value pairs in raw JSON format: path (the value returned as “filePath” above) and type (”customIntegrationData”). It should look like this:
    mceclip10.png
  4. Click Send.
  5. The response will return an “id” value that you’ll need in the next step.
    mceclip11.png

Sync Your Integration

  1. Open a new Postman tab, select PUT from the HTTP method dropdown, and enter the URL https://api.toriihq.com/beta/services/sync/custom.
  2. Add your API Key to the “Authorization” tab as you did previously.
  3. In the “Body” tab, enter two key-value pairs in raw JSON format: idFile (the value returned as “id” above) and idAppAccount (the unique ID of your custom integration). It should look like this:
    mceclip12.png
  4. Click Send.
  5. Return to Torii and verify your file upload by checking the app’s “Users” tab ({Your App} > Users) and (if applicable) the license costs in Licenses.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request