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:
Response (success):
{
"id": "123",
"layout": "5",
"module": "system",
"title": "Test page",
"type": 1,
"uri": "test",
"elements": {
"cell_1": [
{
"content": "test content",
"designbox_id": "11",
"hidden_on": "",
"id": "321",
"module": "system",
"order": "1",
"title": "Test block",
"type": "raw"
}
]
}
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:
Request header:
Authorization: Bearer 9802c4a34e1535d8c3b721604ee0e7fb04116c49
Response (success):
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:
Request header:
Authorization: Bearer 9802c4a34e1535d8c3b721604ee0e7fb04116c49
Response (success):
Response (error):
{
"error":"short error description here",
"error_description":"long error description here"
}