You will use this token in your request's Authorization header. Here is an example:
Authorization: Bearer {token}
A secure OAuth application registration system that allows users to register their applications by providing an application name, link, and optional description. The system automatically generates a unique client ID for each registered application and ensures all application links are properly formatted with trailing slashes
# cURL
curl -X POST 'https://divsly-backend.vercel.app/api/v1/create-token' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '{
"registrationId": "your_registration_id",
"email": "user@example.com"
}'
// JavaScript Fetch
const response = await fetch('https://divsly-backend.vercel.app/api/v1/create-token', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
},
body: JSON.stringify({
registrationId: 'your_registration_id',
email: 'user@example.com'
})
});
const data = await response.json();
// Node.js Axios
const axios = require('axios');
const response = await axios.post('https://divsly-backend.vercel.app/api/v1/create-token', {
registrationId: 'your_registration_id',
email: 'user@example.com'
}, {
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
});
// PHP
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://divsly-backend.vercel.app/api/v1/create-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'registrationId' => 'your_registration_id',
'email' => 'user@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_ACCESS_TOKEN",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
# Python (using requests)
import requests
import json
url = "https://divsly-backend.vercel.app/api/v1/create-token"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
payload = {
'registrationId': 'your_registration_id',
'email': 'user@example.com'
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{"message":"Token created
successfully","token":{"id":"cm8zhznm800018m9a95xuia68","accessToken":"oauth
2_7n-noZ1mY","expiresAt":"2026-04-02T05:40:01.995Z"}}
{
"message": "Unauthorized!"
}
{
"success": false,
"error": "error message from caught exception"
}
{
"error": true,
"data": {
"message": "Link Limit Exceeded for your current plan.
Please upgrade!"
}
}