The purpose of this guide is to provide background and instruction for utilizing Sharpen’s API Gateway (not legacy API).
The API Gateway is Sharpen’s external API interface to microservice-based functions. If you’re dealing with an API that contains api.sharpencx.com or api.fathomvoice.com, this is not the api gateway. Instead the api gateway will contain api.sharpen.cx in its URL.
Whereas the legacy api leveraged cKey1 and cKey2 on behalf of the organization as a whole, the api gateway leverages user-based api keys and secrets based on a unique JWT (Json Web Token). The api gateway leverages POST, GET, PUT, DELETE, etc. methods instead of just POST from the legacy API.
Table of Contents
Where to access
The API gateway api calls and documentation can be accessed one of two ways; the API Gateway web page, or the preconfigured collection within the SharpenCare Postman workspace.
API Gateway documentation: Sharpen Public API
API Gateway Postman export: Postman download
Setting up authorization
In order to send API calls using the API gateway, a system of BearerAuth, apiKey, and apiSecret are used. To start off, you need to gather your Json Web Token
Gathering your JWT(Json Web Token)
Create Authorization API call method
Using Postman, import the API collection above
Once imported, navigate to the “Create New Authentication” API call
Identify the ‘Authorization’ tab
Choose ‘Basic Auth’ from the drop down
Enter the credentials of the Sharpen account corresponding with the account you’re interfacing with
Click ‘Send’
Response should look like
Login to App method (alternative to the method above)
Gathering apiKey and apiSecret
Navigate to the Create API Key api call within the imported Postman collection.
Click the ‘Authorization’ tab and choose ‘Bearer Token’.
Insert the token gathered in step 7 of “Gathering your JWT” here
Navigate to the ‘Body’ tab
If you want an expiration on the token, update the date/time to the proper expiration time. If you do not want an expiration, modify the body to look like this.
Click ‘Send’
The return should look like this
The language of the response needs translation to what is expected later in the flow
clientId = api-key
clientSecret = api-secret
Executing API call
The example below is one of many types of API calls which can be run. It shows how to query SharpenDB from the API Gateway. Please refer to the core API Gateway reference to see all available API calls.
Create Table
Identify the ‘Create Table’ request in the Postman collection
Under the ‘Authorization’ tab, set the ‘Type’ to “No Auth”
Under the ‘Headers’ tab add the following keys (
x-api-key
andx-api-secret
)Enter the values in correspondence with what was retrieved in the ‘Gathering apiKey and apiSecret’ section of this document
Under the ‘Body’ tab enter your query in JSON format
Click ‘Send’
The request and response should look something like this…
Query
Identify the ‘SharpenDB2 Select’ request in the Postman collection
Under the ‘Authorization’ tab, set the ‘Type’ to “No Auth”
Under the ‘Headers’ tab add the following keys (
x-api-key
andx-api-secret
)Enter the values in correspondence with what was retrieved in the ‘Gathering apiKey and apiSecret’ section of this document
Under the ‘Body’ tab enter your query in JSON format
Click ‘Send’
The request and response should look something like this…