Making an API Call

The following is an example of a GET users collection:

GET https://<server>/v1/users

 

In this example, users is the resource, and GET is the method used. Guardian endpoints support the following standard methods:

Method Description Example
GET Read data GET /users returns list of users
GET /users/{user_id} returns a user info of the user {user_id}
POST Create a new resource in a collection. This method generally requires additional parameters POST /users will create a new user
PATCH Update information related to a resource. This method generally requires additional parameters. PATCH /users/{user_id} allows you to change fields of the user {user_id}

 

Passing the Access Token

The access token is your authorization key to Guardian data. With a valid access token in hand, you’re ready to make a request to a REST interface.

 

The access token is an OAuth bearer token, and is included in the header of your requests with the following syntax:

Authorization: Bearer <Access-Token>

 

Example Header:

curl -v https://<server>/v1/users \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <Access-Token>'

 

Receiving Responses

After sending a request, you will receive a response in JSON format.

If the call is successful, Guardian returns status code of 200 and list of users in this example.