POST
https://api.sfox.com/v1/enterprise/users/verify/:user_id
Submit verification codes to complete email or sms verification.
Request
Path Parameters
Unique ID for this user defined by you that will serve as the shared identifier for this account between you and sFOX.
Body Parameters
Verification requirement method. Possible values:
Verification code sent to the user.
Responses
200: OK
The following is an example response body from verifying an email verification code
{
"data": {
"success": true,
"user_id": "client_account_1",
"type": "email"
}
}
The following is an example response body from verifying an sms verification code
{
"data": {
"success": true,
"user_id": "client_account_1",
"type": "sms"
}
}
Example Requests
curl -X POST \
-H 'Content-type: application/json' \
-H "Authorization: Bearer ${ENTERPRISE_API_TOKEN}" \
--data '{ "type": "email",
"otp": "12345" }' \
"https://api.sfox.com/v1/enterprise/users/verify/${USER_ID}"
const axios = require('axios');
const user_id = "user_id"
const data = JSON.stringify({
type: 'email',
otp: '12345'
})
const config = {
method: 'post',
url: `https://api.sfox.com/v1/enterprise/users/verify/${user_id}`,
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.ENTERPRISE_API_TOKEN}`
},
data: data
}
axios(config)
.then((response) => {
console.log(response.status)
console.log(respones.data)
})
.catch(err => {
console.error(err.response.status)
console.error(err.response.data)
});
import requests
import os
user_id = os.environ['USER_ID']
data = requests.post(
f"https://api.sfox.com/v1/enterprise/users/verify/{user_id}",
headers={
"Authorization": f"Bearer {os.environ['ENTERPRISE_API_TOKEN']}"
},
json={
"type": "email",
"otp": "12345"
}
)
print(data.status_code)
print(data.json())
Last updated