Accounts
Authentication to apps.
Get Accounts
GET
/auth/:componentType
Get the list of accounts the user has previously authenticated with for this component type.
curl "https://api.acme.com/auth/appmixer.slack.list.SendChannelMessage?componentId=e15ef119-8fcb-459b-aaae-2a3f9ee41f15" -H "Authorization: Bearer [ACCESS_TOKEN]"
Path Parameters
Name | Type | Description |
---|---|---|
componentType | string | Component Type. |
Query Parameters
Name | Type | Description |
---|---|---|
componentId | string | Component ID. |
Get All Accounts
GET
/accounts
Get the list of all accounts the user has authenticated with to any component.
curl "https://api.appmixer.com/accounts" -H "Authorization: Bearer [ACCESS_TOKEN]"
Query Parameters
Name | Type | Description |
---|---|---|
filter | string | You can filter accounts. |
Example of filtering certain accounts:
Update Account Info
PUT
/accounts/:accountId
Update account information. Currently, only the display name can be updated. The display name is visible in the Designer inspector when selecting available accounts for a component type and also on the Accounts page.
curl -XPUT "https://api.appmixer.com/accounts/5a6e21f3b266224186ac7d03" -H "Authorization: Bearer [ACCESS_TOKEN]" -H "Content-Type: application/json" -d '{ "displayName": "My Account Name" }'
Path Parameters
Name | Type | Description |
---|---|---|
accountId | string | The ID of the account to update. |
Request Body
Name | Type | Description |
---|---|---|
string | Human-readable name of the account. |
Create Account
POST
/accounts
This can be used to create an account. Usually, an account is created when the user authenticates a component. There are scenarios where it is beneficial to create an account without user interaction (Integrations). There has to be an authentication module (auth.js) installed in Appmixer corresponding to the `service` ID. All the built-in authentication types are supported (Oauth1, Oauth2, API Key).
Query Parameters
Name | Type | Description |
---|---|---|
validateScope | string | If |
requestProfileInfo | string | If |
Request Body
Name | Type | Description |
---|---|---|
displayName | string | Display name property of the account. This overrides the name of the account in the frontend. |
name | string | Name of the account, the authentication will determine the name of the account using the |
service | string | ID (vendor:service) of the service - `appmixer:google` for example. |
token | object | The structure of this object depends on the authentication type (Oauth1, Oauth2, API Key). |
profileInfo | object | Can be provided directly. If not, |
Below is an example of a request to create s Slack (Oauth2) account.
The profileInfo
object is optional. If you provide it it will be used. If you do not provide it then the requestProfileInfo
from the authentication module will be used to get the profile info. Slack access tokens do not expire, therefore there is neither an expiration date nor a refresh token in the request.
Below is another example, this time for Google (Oauth2) account with access token expiration:
One more example, this time an API Key account:
Test Account
POST
/accounts/:accountId/test
Test account. Check if all the credentials (tokens) are still valid for the account.
curl -XPOST "https://api.appmixer.com/accounts/5a6e21f3b266224186ac7d03/test" -H "Authorization: Bearer [ACCESS_TOKEN]"
Path Parameters
Name | Type | Description |
---|---|---|
accountId | string | Account ID. |
Remove Account
DELETE
/accounts/:accountId
Remove the account and stop all the flows that this account is used in.
curl -XDELETE "https://api.appmixer.com/accounts/5a6e21f3b266224186ac7d03" -H "Authorization: Bearer [ACCESS_TOKEN]"
Path Parameters
Name | Type | Description |
---|---|---|
accountId | string | Account ID. |
List All Flows Using Account
GET
/accounts/:accountId/flows
List all the flows where the account is used.
curl "https://api.appmixer.com/accounts/5a6e21f3b266224186ac7d03/flows" -H "Authorization: Bearer [ACCESS_TOKEN]"
Path Parameters
Name | Type | Description |
---|---|---|
accountId | string | Account ID. |
Generate Authentication Session Ticket
POST
/auth/ticket
Generate an authentication session ticket. This is the first call to be made before the user can authentication to a service. The flow is as follows:
1. Generate an authentication session ticket.
2. Get an authentication URL.
3. Start an authentication session.
4. Open the authentication URL in a browser to start the authentication flow.
5. Once the user completes the authentication flow, the browser redirects the user to a special Appmixer page which posts a message of the form "appmixer.auth.[success/failure].[ticket]" via the window.postMessage() call: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage.
Note that this is a low-level mechanism that you don't have to normally deal with. The Appmixer JS SDK handles all this for you.
curl "https://api.appmixer.com/auth/ticket" -H "Authorization: Bearer [ACCESS_TOKEN]"
Get Authentication URL
GET
/auth/:componentType/auth-url/:ticket
Get an authentication URL.
curl "https://api.appmixer.com/auth/appmixer.slack.list.SendChannelMessage/auth-url/58593f07c3ee4f239dc69ff7:1d2a90df-b192-4a47-aaff-5a80bab66de5" -H "Authorization: Bearer [ACCESS_TOKEN]"
Path Parameters
Name | Type | Description |
---|---|---|
ticket | string | Authentication ticket. |
componentType | string | Component type. |
Query Parameters
Name | Type | Description |
---|---|---|
string | Component ID. |
Start Authentication Session
PUT
/auth/:componentType/ticket/:ticket
Start the authentication session.
curl -XPUT "https://api.appmixer.com/auth/appmixer.slack.list.SendChannelMessage/ticket/58593f07c3ee4f239dc69ff7:68982d38-d00c-4345-9a4a-82360d7e1649" -H "Authorization: Bearer [ACCESS_TOKEN]"
Path Parameters
Name | Type | Description |
---|---|---|
ticket | string | Authentication session ticket. |
componentType | string | Component type. |
Clear Authentication From Component
DELETE
/auth/component/:componentId
Clear authentication associated with the component. Note that this call does not remove the account, it only removes the association of an account with a component.
curl -XDELETE "https://api.appmixer.com/auth/component/e25dc901-f92a-46a2-8d29-2573d4ad65e5" -H "Authorization: Bearer [ACCESS_TOKEN]"
Path Parameters
Name | Type | Description |
---|---|---|
componentId | string | Component ID. |
Assign Account To Component
PUT
/auth/component/:componentId/:accountId
Assign an account to a component.
curl -XPUT "https://api.appmixer.com/auth/component/e25dc901-f92a-46a2-8d29-2573d4ad65e5/5a6e21f3b266224186ac7d03" -H "Authorization: Bearer [ACCESS_TOKEN]"
Path Parameters
Name | Type | Description |
---|---|---|
accountId | string | Account ID. |
componentId | string | Component ID. |
Last updated