API Documentation

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {ACCESS_TOKEN}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Connect OAuth

To connect to Roborder API, you can use the standard OAuth 2 to get an ACCESS TOKEN.

Setup OAuth

To use OAuth, follow these steps in your Roborder Dashboard to generate OAuth Credentials:

  • Go to Developer > Apps in sidebar menu in your Dashboard and Click on Add App button.
  • Enter App Details (name, description, logo) then click on Save. This will automatically generate the OAuth credentials (Client ID and Client SECRET).
  • Enter your redirect URI - Example: https://your-app.com/callback

Authorization Request

To obtain an authorization code, redirect user to Roborder with the following URL:

Exchange Code for Access Token

User will accept the request via the authorization page, they will be redirected to the specified redirect URI (https://your-app.com/callback). You can then exchange the authorization code for an access token.

POST
https://api.roborder.ai
/oauth/token

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Form Parameters

Example request:
curl --request POST \
--post "https://api.roborder.ai/oauth/token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--form-data "{
\"grant_type\": \"authorization_code\",
\"client_id\": \"< CLIENT ID >\"
\"client_secret\": \"< CLIENT SECRET >\"
\"redirect_uri\": \"https://your-app.com/callback\"
\"code\": \"< CODE >"
}"
                        
Example response:

Refresh Token

The access token typically has a lifetime of one year unless it's revoked. You can refresh it using the refresh_token attribute you got from the response. Here's an example of how to refresh it:

POST
https://api.roborder.ai
/oauth/token

Headers

Content-Type
Example:
application/json
Accept
Example:
application/json

Form Parameters

Example request:
curl --request POST \
--post "https://api.roborder.ai/oauth/token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--form-data "{
\"grant_type\": \"authorization_code\",
\"client_id\": \"< CLIENT ID >\"
\"client_secret\": \"< CLIENT SECRET >\"
\"redirect_uri\": \"https://your-app.com/callback\"
\"code\": \"< CODE >"
}"
                        

Endpoints

Get User

GET
https://api.roborder.ai
/v1/user
requires authentication

Headers

Authorization
Example:
Bearer {ACCESS_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request GET \
    --get "https://api.roborder.ai/v1/user" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"user_id\": \"1111\"
}"
Example response:
{
"success":true,
"data": {
  "id": 1111,
  "email": "user@gmail.com",
},
"message":"Get User successfully."
}

Store Product

POST
https://api.roborder.ai
/v1/products
requires authentication

Headers

Authorization
Example:
Bearer {ACCESS_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
curl --request POST \
    "https://api.roborder.ai/v1/products" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"eius\",
    \"sku\": \"ab\",
    \"link\": \"https:\\/\\/www.example.com\\/product-name\",
    \"sell_price\": 100,
    \"image\": \"https:\\/\\/www.example.com\\/product-name.jpg\",
    \"description\": \"Perferendis nam voluptatem cumque vel omnis.\"
}"
Example response:
{
    "success": true,
    "message": "Product stored successfully."
}

List Products

GET
https://api.roborder.ai
/v1/products
requires authentication

Headers

Authorization
Example:
Bearer {ACCESS_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
curl --request GET \
    --get "https://api.roborder.ai/v1/products" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
"success":true,
"data": {
  "id": 1,
  "sku": "product-sku",
  "name": "product-name",
  "description": "product-description",
  "link": "https://www.example.com/product-name",
  "sell_price": 100
  "image": "https://www.example.com/product-name.jpg"
},
"message":"Get Products successfully."
}

List Orders

GET
https://api.roborder.ai
/v1/orders
requires authentication

Headers

Authorization
Example:
Bearer {ACCESS_TOKEN}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
curl --request GET \
    --get "https://api.roborder.ai/v1/orders" \
    --header "Authorization: Bearer {ACCESS_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
Example response:
{
"success":true,
"data": {
  "id": 1,
  "customer_name": "customer-name",
  "platform": "Facebook",
  "phone": "22222222",
  "page": {
     "id": "1",
     "name": "page-name",
     "link": "https://www.facebook.com/100089461361197004",
   },
 "products": [
        {
           "id": 1,
           "sku": "1234",
           "name": "product-name",
           "link": "https://www.example.com/product-name",
           "price": 100,
         }
   ],
   "sheet": {
       "id": 1,
       "spreadsheet_name": "sheet-name",
       "spreadsheet_id": "1k4IwMwZQdwciuXA1mCOnGEL2pSWmMXwJyzHvbbXVu7o",
       "email": "user@gmail.com"
    }
},
"message":"Get Orders successfully."
}