UNA
Loading...
Searching...
No Matches
API Public

Public API for getting secure token for API Private calls and other calls which don't require user authentication

/m/oauth2/com/test

Test method to check public API

HTTP Method: GET

Request params: n/a

Response (success):

{
"result": "Test passed."
}

/m/oauth2/com/get_page

Get page with cells and blocks as array

HTTP Method: GET

Request params:

  • uri - page URI

Response (success):

{
"id": "123", // page ID
"layout": "5", // page layout, 5 is simplest page with one cell
"module": "system", // module which this page
"title": "Test page", // page title
"type": 1, // page type, 1 is for default page with header and footer
"uri": "test", // page URI, which is part of page URL
"elements": {
"cell_1": [
{
"content": "test content", // block content, it can be array as well
"designbox_id": "11", // block design, such as padding, border, title
"hidden_on": "", // not empty block need to be hidden on mobile, or desktop
"id": "321",
"module": "system", // module name this block is related to
"order": "1", // block order
"title": "Test block", // block title
"type": "raw" // block type
}
]
}

Response (error):

{
"error":"short error description here",
"error_description":"long error description here"
}

/m/oauth2/com/reset_password_send_request

Send email with reset password code

Scopes: api

HTTP Method: POST

Request params:

  • email - email address

Request header:

Authorization: Bearer 9802c4a34e1535d8c3b721604ee0e7fb04116c49

Response (success):

{
"code": 200,
}

Response (error):

{
"error":"short error description here",
"error_description":"long error description here"
}

/m/oauth2/com/reset_password_check_code

Check validation code & set new password

Scopes: api

HTTP Method: POST

Request params:

  • code - validation code
  • email - email address

Request header:

Authorization: Bearer 9802c4a34e1535d8c3b721604ee0e7fb04116c49

Response (success):

{
"code": 200,
"password" : "[NEW PASSWORD]"
}

Response (error):

{
"error":"short error description here",
"error_description":"long error description here"
}

/m/oauth2/com/create_account

Create account

Scopes: api

HTTP Method: POST

Request params:

  • name - account name
  • email - email address
  • password - password

Request header:

Authorization: Bearer 9802c4a34e1535d8c3b721604ee0e7fb04116c49

Response (success):

{
"code": 200,
"profile_id" : "[PROFILE ID]"
}

Response (error):

{
"error":"short error description here",
"error_description":"long error description here"
}

/m/oauth2/api/com

API service call (com is for command). The call should be look this: /m/oauth2/api/com/[metod-name-here]

Scopes: api

Everything is equivalent to /m/oauth2/api/service, only module name parameter can be ommited and method is passed as method parameter instead of GET/POST variable

/m/oauth2/token

Get the token for the future communication with API Private

HTTP Method: POST

Request params:

  • grant_type - for API it's better to use 'password' grant type
  • username - login email
  • password - login password
  • client_id - client ID from bx_oauth_clients table

Response (success):

{
"access_token":"cdd7056d0adafa9ead87526ca22367c6b0df8273",
"expires_in":3600,
"token_type":"Bearer",
"scope":"basic",
"refresh_token":"c3d7f6f4b7cc640214ae0cba2b194872c3089f1c"
}

Response (error):

{
"error":"short error description here",
"error_description":"long error description here"
}

/m/oauth2/revoke

Revoke token

HTTP Method: POST

Request params:

  • token - token to revoke

Request header:

Authorization: Bearer 9802c4a34e1535d8c3b721604ee0e7fb04116c49

Response (success):

{
"revoked":true,
}

Response (error):

{
"error":"short error description here",
"error_description":"long error description here"
}