Create Multiple User Auth Tokens
POST
https://api.sfox.com/v1/enterprise/user-tokens
Generate a user auth token for multiple end users.
User auth tokens are short-lived authentication tokens, expiring 24 hours after creation (expiration of a given token specified in the expires field of the response). User auth tokens are used for actions specific to a user's account (e.g. Initiate an ACH Deposit, Create an Order).
Request
Body Parameters
data
required, [string]
Array of user_id strings.
user_id
required, string
The IDs of the user(s) to create user auth tokens for. At least 1 user_id must be specified in the array.
Example Requests
curl -X POST \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer ${ENTERPRISE_API_KEY}" \
--data '{ "data": ["${USER_ID_1}", "${USER_ID_2}"]}' \
'https://api.sfox.com/v1/enterprise/user-tokens'const axios = require('axios');
const payload = JSON.stringify({
"data": [
'${USER_ID_1}',
'${USER_ID_1}'
]
})
const config = {
method: 'post',
url: 'https://api.sfox.com/v1/enterprise/user-tokens',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.ENTERPRISE_API_KEY}`
},
data: data
}
axios(config)
.then(response => {
console.log(response.status)
console.log(response.data)
}).catch(err => {
console.error(err.response.status)
console.error(err.response.data)
});import requests
import os
data = requests.post(
"https://api.sfox.com/v1/enterprise/user-tokens",
headers={
"Authorization": f"Bearer {os.environ['ENTERPRISE_API_KEY']}",
},
json={
"data": ["${USER_ID_1}", "${USER_ID_2}"]
}
)
print(data.status_code)
print(data.json())Response
Response Fields
data
[object]
Array of user auth token objects.
token
string
The user authentication token that you will use to access this specific user's sFOX account
partner_user_id
string
The user_id the token grants access to.
expires
string
The expiration date of the user auth token. ISO-8601 date and time in UTC time zone.
Responses
Last updated