Last updated
Was this helpful?
Last updated
Was this helpful?
You in your or to authorize your use of the Seam API. When using the Seam HTTP API or any of the Seam SDKs, you must provide this API key to issue commands that enable you to control the devices in the associated workspace. It is useful to as an environment variable. You can also .
Never use an API key in a web browser or expose it to your users.
Each API key is associated with a specific workspace. For example, if you have a sandbox workspace and a production workspace, you must create and use a different API key for each of these two workspaces.
In the upper-left corner of , click the workspace switcher.
Click New Workspace.
Click the workspace for which you want to create an API key.
In the left navigation pane, click API Keys.
In the upper-right corner of the API Keys page, click Add API Key.
In the Add API Key dialog, type a name for your new API key and then click Create API Key.
Copy the newly-created API key and store it for future use.
Once you have created an API key, it is useful to export this key as an environment variable. Then, all installed Seam SDKs automatically use this exported API key.
Open a terminal window and enter the following command to export your API key:
First, export the API key, as follows:
Then, run the following code to test the API key:
Code:
Output:
Test an API key by as an environment variable and then running the code in this section. If the API key is valid, the response displays the corresponding workspace information.
Create an API key for authorization that enables you to control devices connected to a specific Seam workspace.