Download OpenAPI specification:Download
At Gladly, we believe that customer service is best when it's a conversation. That means more than just helping customers with one-off questions or issues: it's about making them feel known, valued, and respected for the individuals they are.
The Gladly API was built to help facilitate those relationships, providing agents with the rich customer context they need to deliver seamless experiences that make customers feel like they're more than just a number in a sea of others.
You can integrate easily with Gladly by calling Gladly's REST API and implementing the Lookup API to provide data from your own services.
Some examples of what you do through Gladly APIs include managing customer profile data, interacting with a customer's timeline, providing the latest information about a customer's orders, and more.
Clients can access the REST API via HTTPS at your organization's Gladly domain (e.g. https://{organization}.gladly.com
).
Resources follow REST semantics and utilize industry-standard HTTP verbs, response codes, and authentication schemes. In addition, all responses and payloads are in JSON with consistent error codes and formats.
The Gladly Lookup API allows your organization to provide data services to power the agent's experience with a complete view of your customers' information, transactions, and activity. You can provide a web service that implements the Lookup API and Gladly will call it when that data is needed.
Like the REST API, the Lookup API is specified using REST semantics, and exchanges JSON requests and responses authenticated and signed with secure keys.
Gladly will perform lookups when certain activities occur within Gladly, such as when a customer's profile is loaded.
A detailed overview of Lookup Adaptor architecture, requests, resposnes and more can be found here.
Test the myriad possibilities of the Gladly API in a safe, secure space. We'll enable the Gladly API in a separate sandbox environment, so you can experiment freely without impacting your production environment (or vice versa).
Your sandbox environment is accessible at https://{organization}.gladly.qa
, where organization
is your company name. For specific API endpoints, see documentation below.
Think of this section as getting the keys to unlocking your access to the Gladly APIs. First, you'll need to set up an account with the necessary API permissions. With these permissions, you can then go on to create the API Token(s) you need to access Gladly's API resources.
Gladly Administrators can set API permissions on an agent-by-agent basis. We'll discuss how this maps to API access in the section on authentication below.
To allow a user to create API tokens and access the API:
We recommend creating a dedicated user to make API calls, whose account won't be used for agent and organization management. This will help you with any future audits of API activity vs. agent activity.
You must create an API token to access Gladly API resources (see above Permissions). If your profile already has access to the API User permission, you'll see a menu item titled More settings. Click More settings:
Click API Tokens, then the Create Token button on the upper right-hand corner of the page:
A token will be generated and named, by default, New Token (though depending on whether you have existing tokens, it may be named New Token 2, or New Token 3, etc.). You can rename the token to something more easily referenceable by clicking the name to edit.
This token will be associated with your agent profile, which we refer to as the API User in this document.
For security purposes, you'll only see a new token once before you navigate away from the page.
Should you lose this token, or wish to rotate your application keys, you can do the following:
Gladly API uses token-based Basic Authentication. API tokens are associated with designated Gladly users. To create and use an API token, your user must have the API User permission. An API token can be used to perform any API request without restriction.
user name | password |
---|---|
agent email | API token |
The credentials must be passed via an Authorization
HTTP header. All requests must be made over HTTPS.
curl -u user@organization.com:$GLADLY_API_TOKEN \
https://organization.gladly.com/api/v1/organization
Security Scheme Type | HTTP |
---|---|
HTTP Authorization Scheme | basic |
An Agent represents the user profile of a person who helps customers in Gladly. The API allows you to lookup Agents who participated in conversations with customers.
Get an agent profile by their unique id.
agentId required | string Example: WmeA3Y51Q5ayCAaZ1AotIA id of the agent |
Agent
{- "id": "WmeA3Y51Q5ayCAaZ1AotIA",
- "name": "Amy Agent",
- "emailAddress": "amy.agent@company.com"
}
Get an agent call recording status.
agentId required | string Example: WmeA3Y51Q5ayCAaZ1AotIA OR agent@customer.com Gladly ID or Gladly email address of the agent |
CallRecorder
Agent not found
{- "agentId": "WmeA3Y51Q5ayCAaZ1AotIA",
- "customerId": "ZcyobierQhucTS5GV1R2Fw",
- "conversationItemId": "g6UatsvAQC69AcDpOKF-yQ",
- "recording": "true"
}
Update an agent's active call recording status. This API allows changing the recording
property.
agentId required | string Example: WmeA3Y51Q5ayCAaZ1AotIA OR agent@customer.com Gladly ID or Gladly email address of the agent |
JSON patch of CallRecorder
agentId | string Id of the agent |
customerId | string Id of the customer on the call, if the agent is on a call. If the agent is not on a call this is omitted |
conversationItemId | string Id of the conversation item of the call, if the agent is on a call. If the agent is not on a call this is omitted |
recording | boolean If the call is currently being recorded or not |
Call recording updated. If an agent is not on a call the update will do nothing.
Agent not found
{- "recording": false
}
{- "errors": {
- "code": "not_exist",
- "detail": "agent WmeA3Y51Q5ayCAaZ1AotIA does not exist"
}
}
A Public Answer in Gladly represents a consumer-facing Answer.
The Public Answers API allows you to search and retrieve Public Answers (created directly in the Gladly UI), which you can display in the Glad App web widget, use to build your website's help center/FAQ page, or publish on any page on your website.
This API can be used without an API token because it only provides access to public content. You may also work with Gladly Support to enable CORS access so the API can be used directly from client-side javascript.
Returns a list of answers that match the provided query string.
orgId required | string Example: ihKsWxiZCDVtXg1iwVmT9Q id of your organization You can look up the ID using the Get organization API. |
q | string Example: q=reset%20password search term |
lng | string Example: lng=en-us language code |
audienceId | string Example: audienceId=en-us Audience ID. The Audience ID can be retrieved by going to Settings > Audiences in Gladly, then clicking on the Edit button next to the Audience in question. The ID will be in the page URL. |
found answers
[- {
- "id": "1grfSzATQLa334VDLCWc4A",
- "name": "How to reset your password"
}
]
Returns the first 1000 public answers sorted alphabetically by name.
orgId required | string Example: ihKsWxiZCDVtXg1iwVmT9Q id of your organization You can look up the ID using the Get organization API. |
lng | string Example: lng=es-419 Language of the answers returned Defaults to |
audienceId | string Example: audienceId=ihKsWxiZCDVtXg1iwVmT9Q Audience ID for answers returned - optional. The Audience ID can be retrieved by going to Settings > Audiences in Gladly, then clicking on the Edit button next to the Audience in question. The ID will be in the page URL. |
answers
[- {
- "id": "1grfSzATQLa334VDLCWc4A",
- "name": "How to reset your password",
- "bodyHtml": "<div><a href=\"/reset-password\">Click here</a> to reset your password</div>",
- "language": "en-us",
- "updatedAt": "2023-05-22T10:00:00.000Z"
}
]