To register a new user in the system, please use our UI. To register a new user at Staging environment, please go to https://staging.channex.io/. To register a new user at Production environment, please go to https://app.channex.io/.
Early, we have public API method to register new User, but this API is Deprecated right now.
Authenticate a user at the system.
Request:
POST https://staging.channex.io/api/v1/sign_in
Query body (JSON):
{"user" : {"email": "user@channex.io","password": "password",}}
Success Response Example
Status Code: 200 OK
{"meta": {"message": "You are successfully logged in! Add this token to authorization header to make authorized requests."},"data": {"type": "session","attributes": {"token": "AUTH_TOKEN","refresh_token": "REFRESH_TOKEN"},"relationships": {"user": {"data": {"type": "user","id": "2cd26047-db52-4c54-8c28-98099021c480","attributes": {"id": "2cd26047-db52-4c54-8c28-98099021c480","email": "user@channex.io","name": "Channex User","system_role": "user"}}}}}}
Unauthorised Error Response
Status Code: 401 Unauthorized
{"errors": {"code": "unauthorized","title": "Unauthorized"}}
Method requires a valid User Authentication object as incoming argument represented as type user
.
email [required]
String with a valid email address.
password [required]
Non empty string with at least 8 symbols of length. Any symbols are allowed.
Success
Method can return a Success result with 200 OK
HTTP Code if operation is successful. Will contain a Session object in the answer.
Please, keep in mind, our token
is short live and expired at 24 hours. To get new token, you should call Refresh endpoint and sign this request by Refresh Token.
Unauthorised Error
Method can return Unauthorised Error result with 401 Unauthorized
HTTP Code if email or password is not valid. By security reason, if provided email is not represented at system we will return a Unauthorised error also.
Request sending restore password instructions to user email.
Request:
POST https://staging.channex.io/api/v1/request_restore_password
Query body (JSON):
{"user" : {"email": "user@channex.io"}}
Success Response Example
Status Code: 200 OK
{"meta": {"message": "Instructions to restore password was send successfully!"}}
Method require valid User object as incoming argument represented as type user
.
email [required]
String with valid email address.
Success
Method can return Success result with 200 OK
HTTP Code if operation is successful. Will contain meta object with message.
For security reasons this method will return Success result for each request.
Set new user password
Request:
POST https://staging.channex.io/api/v1/restore_password
Query body (JSON):
{"user": {"restore_password_token": "RESTORE_TOKEN","password": "password","password_confirmation": "password"}}
Success Response Example
Status Code: 200 OK
{"meta": {"message": "Password was restored!"}}
Bad Request Error Response
Status Code: 400 Bad Request
{"errors": {"code": "bad_request","title": "Bad Request"}}
Validation Error Response
Status Code: 422 Unprocessable Entity
{"errors": {"code": "validation_error","title": "Validation Error","details": {"password_confirmation": ["does not match confirmation"]}}}
Method requires a valid User object as incoming argument represented as type user
.
restore_password_token [required]
String value. restore_password_token
will be sent via email when user calls Request Restore Password Instructions.
password [required]
Non empty string with at least 8 symbols of length. Any symbols is allowed.
User will use this password to login into the system.
password_confirmation [required]
Non empty string with at least 8 symbols of length. Should be equal to password field value.
Success
Method can return Success result with 200 OK
HTTP Code if operation is successful. Will contain meta object with message.
Bad Request Error
Method can return a Bad Request Error result with 400 Bad Request
HTTP Code if restore_password_token
is invalid.
Validation Error
Method can return Validation Error result with 422 Unprocessable Entity
HTTP Code if any validation rule is failed.
Confirm user registration by sending a token to the users email address and validating it is a valid email address.
Request:
GET https://staging.channex.io/api/v1/confirm_registration?token=TOKEN
Success Response Example
Status Code: 200 OK
{"meta": {"message": "You are successfully confirm your account! Right now you are logged in. Add this token to authorization header to make authorized requests."},"data": {"type": "session","attributes": {"token": "AUTH_TOKEN","refresh_token": "REFRESH_TOKEN"},"relationships": {"user": {"data": {"type": "user","id": "2cd26047-db52-4c54-8c28-98099021c480","attributes": {"id": "2cd26047-db52-4c54-8c28-98099021c480","email": "user@channex.io","name": "Channex User","system_role": "user"}}}}}}
Bad Request Error Response
Status Code: 400 OK
{"errors": {"code": "bad_request","title": "Bad Request"}}
Method require valid Confirmation Token passed as GET argument.
token [required]
String value. token
will be sent to email after registration with the Sign Up method.
Success
Method can return Success result with 200 OK
HTTP Code if operation is successfully finished. Will contain Session object at answer.
Bad Request Error
Method can return Bad Request Error result with 400 Bad Request
HTTP Code if token
is invalid.
Method to exchange Refresh Token to new pair of Access Token and Refresh Token.
Request:
POST https://staging.channex.io/api/v1/refreshHEADERS:Authorization: Bearer {{REFRESH_TOKEN}}​BODY:Empty
Success Response Example
Status Code: 200 OK
{"meta": {"message": "You are successfully logged in! Add this token to authorization header to make authorized requests."},"data": {"type": "session","attributes": {"token": "AUTH_TOKEN","refresh_token": "REFRESH_TOKEN"},"relationships": {"user": {"data": {"type": "user","id": "2cd26047-db52-4c54-8c28-98099021c480","attributes": {"id": "2cd26047-db52-4c54-8c28-98099021c480","email": "user@channex.io","name": "Channex User","system_role": "user"}}}}}}
Bad Request Error Response
Status Code: 400 OK
{"errors": {"code": "bad_request","title": "Bad Request"}}