This document describes how to setup REST/JSON web services in Bright Sites. Please note any questions on how to code REST/JSON will not be supported (we can only answer questions directly related to our API). Pricing information for APIs, can be viewed here. To view the API Documentation, please click here.
Article Sections
- Enable API Access
- Create API Token
- Set API Expiration Date
- Set API Permissions
- Add Overage Warning
- Generate API Hits Report for last 30 days
- Example Call
- API Support
- Related Articles
Enable API Access
- Access the Features section.
- Toggle the API option on. Click Close or Set Up Now to continue.
Create API Token
Each call requires an authentication token, which must be generated in the store administrative area.
- Access the Integrations page.
- Click into the Web Services/API section.
- Click the New API Token button.
In Step 1, apply an expiration date (A) if you need the token to expire on a certain date and/or, add notes (B) to identify what integration the API token is used for. Click Next to proceed or Cancel to exit out.
In Step 2, (this step will NOT appear if you don't have permissions activated) select the permissions for the API Token. Read access only allows the API token to view data, whereas Write/Read allows that API token to view and update data via API. Click Next to proceed or Cancel to exit out.
In Step 3, you will see the created API token. You must copy () it from this screen as it will not be shown again. We also recommend configuring overage warnings as described here. Click Save to create the API token or Cancel to exit out.
NOTE: When you communicate the API key to your programmers we recommend doing so in a secure fashion, as well as using permissions to limit what the API key can access. The API key is a password to your store’s administrative area!
Set API Expiration Date
If needed, the API token can have an expiration date.
- Click the pencil (edit) icon for the API Token.
- Click into the API Token section.
- Toggle the Active option to on.
- Click into the Expiration Date area and select a date from the calendar.
- Click Save to submit changes.
Set API Permissions
You can permission API keys to be “Read" Only or “Read/Write” and this means that an API key can either only return information queried (Read only) or return and update information to the system (Read/Write). API keys that were created prior to 02/05/2019 will default to having full access. API keys created after this date default to Read only access.
If permissions ARE NOT activated for the store, by default, the API token will have full READ/WRITE access. If permissions ARE activated for the store, the default access for the token is READ ONLY.
- Click the pencil (edit) icon for the API Token.
- Click into the Permissions section.
- Set permissions for Order, Products, Users and Vendors to None, Read or Write/Read.
- Click Save to submit changes.
Add Overage Warning
You can set Overage Warnings where you're notified via email if your store hits a certain amount of API calls. To add this, click on Web Services/API (1) under Integrations, then click Overage Warnings (2). Next, input the warning notification e-mail (3), and click on your keyboard to add that email. Repeat this process for multiple email addresses. Then you can add Warning Thresholds (4) which will determine when you're notified via email after your store hits that number of API hits or you can click Delete to remove a threshold. An example of the email can be viewed below. Click Save (5) when finished.
Generate API Hits Report for Last 30 Days
You can generate an API Hits report which will contain the API hits for all your store's end-points for the last 30 days. To generate this, click on Web Services/API (1) under Integrations, then click 30 Day API Hits Report (2). You will see a green notification bar (3) indicating that you can download the report when it's ready and you would click this to download the report (or you can click into the "bell" icon at the top right to download the report). The report will have rows for each API call, and the columns will be for each day for the last 30 days (most recent - oldest). Keep in mind, this does not include the HTTP method used.
Example Call
Please see API guide for more examples and endpoint listing
- Request is the store URL combined with the resource URL. The token is added to the end of the request with ?token= The request may contain JSON information (such as when updating an order). The resource URL may contain the ID of a resource (such as an address, order, or inventory unit). Please see the API guide for more information on the types of requests that can be made.
- Response is the data returned from the system in JSON format.
API Support
- To see a full list of API endpoints, examples, and more, please visit the api guide at: https://docs.mybrightsites.com/#introduction
- Questions about how to use the API must be sent by submitting a ticket here – please do not use our general support channels.
Comments
0 comments
Please sign in to leave a comment.