API Endpoints
Last updated
Last updated
API Endpoints
https://oauth.joinares.com/v1/user
: https://oauth.joinares.com/v1/partner/usage
The user info endpoint is used to retrieve the user object, which includes the user's id, email, and credits left.
This endpoint requires an access token that you received from the OAuth process. Each token has a specific user tied to it.
URL: https://oauth.getares.ai/v1/user
Method: GET
Authorization
Yes
Bearer token for authentication. Replace USER_ACCESS_TOKEN
with an actual access token.
A successful response will return a JSON object containing user information.
message
string
Retrieval status. "Success" if successful.
user
object
The user object.
user.id
string
Unique Identifier for the user.
user.email
string
User's email.
user.credits
number
Number of ARES credits the user has left.
There are a few possible reasons for 401 Unauthorized response:
Example Fetch request in JavaScript:
Alternatively, here's an example HTTP GET request:
This endpoint is used for tracking a user's usage on your platform.
This should be called right before you allow the user to use your tool to deduct the user's ARES credit and tracks to usage to your account.
Will return an error if the user doesn't have enough credits.
URL: https://joinares.com/v1/partner/usage
Method: POST
Authorization
Yes
Bearer token for authentication. Replace USER_ACCESS_TOKEN
with an actual access token.
Content-Type
Yes
Use the value application/json
to specify that the body is in JSON format.
client_id
Yes
string
Your client ID
usage
Yes
string
A short note/description on what the usage is about. This should stay consistent with each usage if it's on the same thing. (Ex. "video generation", "editing 1 video", etc.) Line Item.
credits
Yes
number
The number of credits to deduct from the user's ARES account for this usage.
A successful response will return a JSON like the following:
message
string
Status message. Returns "Success"
if successful.
usage
object
Contains information about the usage for confirmation.
usage.usage_timestamp
timestamp with timezone
Time when the usage is logged.
usage.user_id
string
The user id of the user.
usage.client_id
string
Your client id.
usage.credits_earned
number
Credits the user spend / you earned.
usage.usage
string
Reason for the usage.
One or more parameters is missing.
There are 2 reasons why this error is returned:
No access token provided in the header.
Token/client id mismatch.
User does not have enough credits.
Example Fetch Request In Javascript:
Alternatively, here's an example HTTP POST request:
This happens when the access token is expired. Check .
Quick links: , , ,
This happens when the access token is expired. Check .