Back to top

Vanguard Eden API

HTTP Status Code Summary

HTTP Status Codes

200 - OK Everything worked as expected. |

201 - Created Resource is created successfully

400 - Bad Request The request was unacceptable, often due to missing a required parameter.

401 - Unauthorized No valid API key provided.

403 - Forbidden Accessing the resource is forbidden for this user.

404 - Not Found The requested resource doesn’t exist.

422 - Unprocessable Entity Required fields are missing or cannot be processed.

500, 502, 503, 504 - Server Errors Something went wrong on Vanguard’s end.

Authentication

Regular login

Standard Authentication
POST/login

Authenticate user using username and password, and generate api token.

Example URI

POST https://yourdomain.com/api/login
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Body
username=<username>
password=<password>
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "znveoz1BtUPrhz9Ww6Bq3FrGQZy3ZSusv2C7pTYN4WMGLoGX2o5sYZYNJea0"
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "username": [
    "The username field is required."
  ],
  "password": [
    "The password field is required."
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "error": {
    "code": "4",
    "http_code": 401,
    "message": "These credentials do not match our records."
  }
}

Facebook login

Facebook Authentication
POST/login/facebook

Authenticate user from provided Facebook access token, and generate api token.

Example URI

POST https://yourdomain.com/api/login/facebook
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Body
access_token=<facebook_access_token_here>
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "znveoz1BtUPrhz9Ww6Bq3FrGQZy3ZSusv2C7pTYN4WMGLoGX2o5sYZYNJea0"
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "access_token": [
    "The access token field is required."
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "error": {
    "code": "4",
    "http_code": 401,
    "message": "Invalid access token."
  }
}

Registration

Registration
POST/register

Create’s user account.

Example URI

POST https://yourdomain.com/api/register
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Body
username=<username>
password=<password>
first_name=<first_name>
last_name=<last_name>
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "znveoz1BtUPrhz9Ww6Bq3FrGQZy3ZSusv2C7pTYN4WMGLoGX2o5sYZYNJea0"
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "username": [
    "The username field is required."
  ],
  "password": [
    "The password field is required."
  ],
  "first_name": [
    "The first name field is required."
  ],
  "last_name": [
    "The last name field is required."
  ]
}

Facebook Registration

Facebook Registration
POST/register/facebook

Create new account for user from provided Facebook access token, and generate api token if user account is successfully created.

Example URI

POST https://yourdomain.com/api/register/facebook
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Body
access_token=<facebook_access_token_here>
username=<username>
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "znveoz1BtUPrhz9Ww6Bq3FrGQZy3ZSusv2C7pTYN4WMGLoGX2o5sYZYNJea0"
}
Response  422
HideShow
Headers
Content-Type: application/json
Body
{
  "username": [
    "The username field is required."
  ],
  "access_token": [
    "The access token field is required."
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "error": {
    "code": "4",
    "http_code": 401,
    "message": "Invalid access token."
  }
}

Currently Authenticated User

Authenticated User
GET/me

Get info about currently authenticated user.

Example URI

GET https://yourdomain.com/api/me
Request
HideShow
Headers
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authentication: Bearer <api token here>
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 3,
  "email": "stojanovic.loshmi@gmail.com",
  "username": "aaa",
  "first_name": "Milos",
  "last_name": "Stojanovic",
  "avatar": "//www.gravatar.com/avatar/20208b38fbb6018920da7d038fbc58dc",
  "birthday": null,
  "status": "Active",
  "created_at": {
    "date": "2016-04-20 13:33:46.000000",
    "timezone_type": 3,
    "timezone": "UTC"
  },
  "updated_at": {
    "date": "2016-04-20 13:33:46.000000",
    "timezone_type": 3,
    "timezone": "UTC"
  }
}
Response  401
HideShow
Headers
Content-Type: text/html
Body
Unauthorized.

Generated by aglio on 29 Apr 2016