Skip to content

Instantly share code, notes, and snippets.

@NikitaMelnikov
Last active February 4, 2016 19:17
Show Gist options
  • Save NikitaMelnikov/e739dbf1425189cb971d to your computer and use it in GitHub Desktop.
Save NikitaMelnikov/e739dbf1425189cb971d to your computer and use it in GitHub Desktop.

Sms verification rest api

Authorization

To perform authorization you should subscribe request via http header X-API-TOKEN. If api token is invalid, api returns 401 http status code.

Example api usage

POST /resource HTTP/1.1
Host: test.com
User-Agent: curl/7.43.0
Accept: application/json
X-API-TOKEN: YOUR_TOKEN
Content-Length: 16
Content-Type: application/json

Verification object

{
id: integer,
status: enum(not verified, verified)
}

Create new verification

Route: /verification Method: POST Body:

{«phone»: «+79999999999»}

Response:

  • 201 Created

Response body:

{id: 123, status: «not verified»}

Update verification status

Route: /verification/{id} Route parametes:

  • id: integer - Verification id

Method: PUT Body:

{
   «status»: «verified»
}

Response:

  • 200 Ok
  • 404 Not found

Response body:

{id: 123, status: «not verified»}

Get information about verification

Route: /verification/{id} Route parametes:

  • id: integer - Verification id

Method: GET

Response:

  • 200 Ok
  • 404 Not found

Response body:

{id: 123, status: «verified»}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment