Create User Auth Token(s)

POST https://api.sfox.com/v1/enterprise/user-tokens/:user_id

You must include either a single user_id in the path, or a list of user_ids in the body.

Path Parameters

Parameter
Type
Description

user_id optional

string

User defined ID added to the path to retrieve an auth token for a single user

Body Parameters

Name
Type
Description

data optional

string

Array of user_ids

Response Body

Key
Description

token

The authentication token that you will use to access this specific user account

expires

An ISO-8601 date and time that the token will expire in UTC time zone

partner_user_id

The unique ID for this end user shared between sFOX and your enterprise

Responses

201 Created (single)
Single user id
{
    "data": {
        "token": "bcf5ab0aa8dfebc86460338514dd022d63080277373002e6986d7925375a0087",
        "partner_user_id": "client_db29326e-5df6-4d8b-aaaa-b75dc194a0a2",
        "expires": "2024-05-14T19:22:09.901Z"
    }
}
201 Created (multiple)
Multiple users
{
  "data": [
  {
    "token":"911b79b52d8921e57d55bfe4fa182e0e3982e1fa7f202ede548299b1118028f3",
    "expires": "2022-02-08T03:28:56Z",
    "partner_user_id": "156c5beb-7c9f-4f68-83c0-9479703ac490"
  },
  {
    "token":"811d79b52d8921e57d55bfe4fa182e0e3982e1fa7f202ede548299b1117467c5",
    "expires": "2022-02-08T03:28:56Z",
    "partner_user_id": "236f5cdc-7h82-6fh3-h37s-9382840de46575"
  }
  ]
}

Example Requests: Single User

export userId="156c5beb-7c9f-4f68-83c0-9479703ac490"

curl -X POST \
-H "Authorization: Bearer ${ENTERPRISE_API_KEY}" \
"https://api.sfox.com/v1/enterprise/user-tokens/${userId}"

Example Requests: Multiple Users

curl -X POST \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer ${ENTERPRISE_API_KEY}" \
--data '{ "data": ["156c5beb-7c9f-4f68-83c0-9479703ac490", "236f5cdc-7h82-6fh3-h37s-9382840de46575"]}' \
'https://api.sfox.com/v1/enterprise/user-tokens'

Last updated