auth.createAccessToken
POST
https://relay.bluejeans.com/api/auth/accesstokens
Create an AccessToken that can be used in place of Basic Authorization.
You must supply either Basic Auth credentials or a Seam Access Token in this request.
We support Seam User Access Tokens or Seam Enterprise Access Tokens.
Once you have your Relay AccessToken, it can be sent as a query parameter (
?accesstoken=DFG67SD876DFG76SDF5) or as a header (X-Access-Token: DFG67SD876DFG76SDF5).
Tokens are valid for two weeks by default or 1 day for Zero Touch pairing codes, after which you can repeat this process to request a new token. You may also specify a custom duration with the optional duration query parameter.POST /api/auth/accesstokens HTTP/1.1
Authorization: Basic bXl1c2VybmFtZTpteXBhc3N3b3Jk
HTTP/1.1 200 OK
Content-Type: application/json
{
"accessToken": "DFG67SD876DFG76SDF5",
"clientName": null,
"creationDate": 1418375348052,
"enterpriseName": "myenterprise",
"expirationDate": 1419584948052,
"roles": [ "ROLE_READONLY", "ROLE_READWRITE" ]
}
// First, exchange your Basic Auth credentials for a Relay AccessTokenGET /api/enterprises/self?accesstoken=DFG67SD876DFG76SDF5 HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "53aa2cafe4b044cc59538612",
"name": "myenterprise",
"label": "My Enterprise",
"password": null,
"tags": [],
"publicKey": null,
"pointOfContact": "relay-admin@corp.com"
}
// Second, use the new AccessToken in a query param for subsequent requestsGET /api/enterprises/self HTTP/1.1
X-Access-Token: DFG67SD876DFG76SDF5
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "53aa2cafe4b044cc59538612",
"name": "myenterprise",
"label": "My Enterprise",
"password": null,
"tags": [],
"publicKey": null,
"pointOfContact": "relay-admin@corp.com"
}
// Or use the new AccessToken in a header instead of a query param
inputs
seamaccesstoken
Optional Seam Access Token to use instead of Basic Auth.
String
QUERY
no
POST /api/auth/accesstokens?seamaccesstoken=f754583448814a31960a1052df53384f HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"accessToken": "DFG67SD876DFG76SDF5",
"clientName": null,
"creationDate": 1418375348052,
"enterpriseName": "myenterprise",
"expirationDate": 1419584948052,
"roles": [ "ROLE_READONLY", "ROLE_READWRITE" ]
}
roles
Comma-separated list of roles that the token should grant. Omit to grant default roles of
String
QUERY
no
ROLE_READWRITE,ROLE_READONLY.?roles=ROLE_READONLY
duration
How long, in milliseconds, the token should be valid. Omit or pass
long
QUERY
no
0 for the default 2-week duration. Pass -1 for a token that never expires.POST /api/auth/accesstokens?roles=ROLE_READONLY&duration=-1&clientname=my_relay_client_app HTTP/1.1
Authorization: Basic bXl1c2VybmFtZTpteXBhc3N3b3Jk
HTTP/1.1 200 OK
Content-Type: application/json
{
"accessToken": "DFG67SD876DFG76SDF5",
"clientName": "my_relay_client_app",
"creationDate": 1418375348052,
"enterpriseName": "myenterprise",
"expirationDate": null,
"roles": [ "ROLE_READONLY" ]
}
clientname
Arbitrary name of your client app to store with this token. An admin will see this when they revoke a token.
String
QUERY
no
code
a Zero Touch pairing code which is used with the seamaccesstoken to create an Access Token specifically for Zero Touch. See authentication for an explanation of how to use these Access Tokens for Zero
String
QUERY
no
outputs
An object containing the token string itself, your Enterprise username, the timestamp when the token will be expired, and the roles that have been granted and any other additional data.
application/json
AccessToken