How to Use the Operator API
  • 28 Feb 2024
  • 1 Minute to read
  • Contributors

How to Use the Operator API


Article Summary

Using the Operator API

How to Set Up the Operator API

Adding Operators to your site is necessary to populate the users who will be running the Apps developed in Tulip. Operators are traditionally created within Settings by Account Owners. You can also create these operators using an external system via the Tulip API.

Adding an Operator API Token

In your Tulip site, navigate to your profile in the top right corner.

Select the Settings options from this menu.

Within Settings, select the API Tokens option.

On the right side of this page, select Create API Token.

In the Creation, give the API Token a name and make sure it has the Users:Write scope selected, then click Create.

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)/tables/(TableID)/records

Then, under Authorization, select Basic Auth and plug in 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:

Hit 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, make sure to check the Key and Secret are correct. For more information on specific response codes, check out the API Documentation section on the API Tokens page.


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?