How to Use the Operator API
  • 03 Oct 2024
  • 1 Minute to read
  • Contributors

How to Use the Operator API


Article summary

Learn how to set up the Operator API

Access Tulip's API documentation here.

Advanced Content

This article assumes previous experience with APIs.

Adding operators to your site is necessary to populate the users who will be running the Apps developed in Tulip. You can create Operators two ways:

  • The Users page, located in Settings
  • Use an external system via the Tulip API.

The procedure below demonstrates how to use the Tulip API to create operators.

Add an Operator API Token

In your Tulip instance, click your profile icon in the top right corner and select Settings.

Configuring Your Tulip Account Settings_124925135

Select API Tokens then click the Create API Token button at the top right.

Create%20API%20token1

In the Creation menu, give the API Token a name and select the users:write scope. Click Create.

Create API Token

Note

Make sure to save the API Token information for the API Key, Secret, and Authorization Header.

Using the Operator API

The following will go through how to create an operator. In this case, the example will use Postman to perform the creation.

First, add your API endpoint to the Post request.

NOTE

If you are using a global API key, you need to specify the workspace. If your API key is workspaced scoped, it is optional.

https://(yourinstancenamehere).tulip.co/api/v3/w/(workspace)/users

Then, under Authorization, select Basic Auth and enter the API Key as the Username, and the API Secret as the Password.

Under Headers, add the Auth Header.

In the Body, format the request to take in the JSON object. The generic format for this request is as follows.

{ "role": "operator", "name": "string", "badge_id": "string" }

This will look something like this:

Click Send to run the request, and you will receive a 201 response to indicate success. To verify, you can check your list of Users in Settings, and confirm the user was successfully created.

If the request failed, check that the Key and Secret are correct. For more information on specific response codes, see Introduction to APIs.


Did you find what you were looking for?

You can also head to community.tulip.co to post your question or see if others have faced a similar question!


Was this article helpful?