Sending TAC Http Request
Sending TAC Http Request
In this article, You will learn how to send a TAC request using TAC Client.
First, Make sure that you have created a TAC client to use as described in this article, In case you don't have any clients created yet learn how to Create & Configure API Client.
Obtaining Client Credentials
- Log in to your tenant using your admin account.
- Navigate to Settings -> API, Which you can find in the sidebar.
- Obtian Public Key from the page header
- Obtain the Client ID and the client's Private Key from the list.
Client Credentials Explained
- Public Key: This is a shared key between all your API Clients to determine your tenant's scope, Each tenant has its own unique public key.
- Client ID: This is an id for your client to determine the client you are using to send requests through TAC APIs, It will always look like an email of your tenant's subdomain. This is an example of how a client id should look like
[email protected]
(This client id is just an example and does not belong to any tenant clients)
- Private Key: Each client has a unique key to authorize the client of making requests.
Private keys look like Public keys so be careful when using these keys. Using the wrong key will decline your requests and might block your connection to the system for a while.
Sending a TAC Request
This is the important part If you are experienced with Postman you can find a collection that includes all the available TAC API endpoints by clicking Spider TAC Postman Workspace. You can also use the Postman collection along with this article to understand how the TAC requests are handled.
Request URL
All of your TAC clients can send requests to the TAC API URL, You can find the TAC URL in the Postman collection production environment under the key API_URL.
Request Headers
Each request to the TAC APIs needs to include these headers to work as expected. You can view the Postman collection Pre-request Script to understand the headers values.
- Accept: Should always have a value of "application/json" without the quotes.
- client-locale: Should have one value of "en", or "ar" without the quotes.
- tac-public-key: Value of your tenant's Public Key, Which can be found on the API page inside your tenant.
- tac-client: Value of Client ID, Which can be found on the API page clients list inside your tenant.
- tac-private-key: Value of Client Private Key, Which can be found on the API page clients list next to the client id you are using.
API Endpoints
All of the available TAC API endpoints, headers, and parameters can be found at Spider TAC Postman Workspace. Where you will find a separate folder for each of our system modules and each module also have a folder for each model, Most of the model request are following the CRUD design pattern.
Every API endpoint will start with the module's key name followed by the resource's key name in a CRUD design pattern.
For example, If we want to create a new Lead resource in the CRM module we will need to use the TAC API URL followed by the module's & resource's name like this {{API_URL}}/crm/leads
and so the Lead resource will have CRUD endpoints as the following:
- GET
{{API_URL}}/crm/leads
- Returns pagination of the resource results - GET
{{API_URL}}/crm/leads/:lead_id
- Gets the resource using the id - POST
{{API_URL}}/crm/leads
- Creates a new resource - PUT
{{API_URL}}/crm/leads/:lead_id
- Updates an existing resource using the id - DELETE
{{API_URL}}/crm/leads/:lead_id
- Deletes an existing resource using the id
Please keep in mind that some resources might not have the full list of the CRUD endpoints as mentioned above, TAC System is still in beta and more resources will be added to TAC APIs soon.