All pages
Powered by GitBook
1 of 1

Loading...

Getting started

The App Academy API version 3 was developed for the practical challenge within the Custom Apps Development course. Access ( username and password ) can be obtained there.

Authorization flow

Step one: Obtain a new token

Before getting access to API version 3, you will need your username and password to get a new access token.

Use your application username and password to issue a request to token endpoint.

You must use password grant type.

A successful request will respond with access_token , expires-in , and refresh_token parameters. Expires-in value is in minutes.

Step two: Make an API request

After obtaining the access token, you can send requests to App Academy API that contain the authorization header in this format: Bearer {access_token}.

Step three: Refresh the access token

The API provides the expires_in parameter in the token response to determine if the user's access token has expired. If it has, to obtain a new access token use the token endpoint with grant_type set to refresh_token .

Expires-in value is in minutes. To obtain a new access token and refresh token, the refresh token must not be expired!

Error handling

Error example

Pagination

App Academy API uses pagination to limit the response size for resources that return a potentially large collection of items. A request to a paged API will result in a results array wrapped in a JSON object with paging metadata, for example:

  • totalRecordsReturned - The number of results returned on the page.

The default (and maximum) page size in pagination is 5.

The default (and maximum) limit of retrieved records is 20.

{
    "error": {
        "message": "Grant type not supported.",
        "code": 501
    }
}
{
    "totalRecordsReturned": 5,
    "records": [
        {
            "id": "1dca6a93fcf1",
            "name": "Robert Downey Jr.",
            "createdAt": "2023-04-13T17:04:47+00:00",
            "updatedAt": "2023-04-19T17:04:47+00:00"
        }
    ]
}

Endpoint to retrieve access token.

post

This endpoint retrieves the access token.

Body
usernamestringRequired
passwordstringRequired
grant_typestringRequiredExample: password
Responses
200

OK

application/json
post
/token

Endpoint to retrieve info about the connected account.

get

This endpoint retrieves info about the connected account.

Header parameters
authorizationstringRequiredExample: Bearer [accessToken]
Responses
200

OK

application/json
get
/whoami

Endpoint to refresh the access token.

post

This endpoint to refresh the access token.

Body
refresh_tokenstringRequired
grant_typestringRequiredExample: refresh_token
Responses
200

OK

application/json
post
/token
200

OK

200

OK

200

OK

{
  "access_token": "text",
  "expires_in": 1,
  "refresh_token": "text"
}
{
  "name": "Jane Doe",
  "username": "[email protected]"
}
POST /api/v3/token HTTP/1.1
Host: app-academy.make.com
Content-Type: application/json
Accept: */*
Content-Length: 53

{
  "refresh_token": "text",
  "grant_type": "refresh_token"
}
{
  "access_token": "text",
  "expires_in": 1,
  "refresh_token": "text"
}
POST /api/v3/token HTTP/1.1
Host: app-academy.make.com
Content-Type: application/json
Accept: */*
Content-Length: 61

{
  "username": "text",
  "password": "text",
  "grant_type": "password"
}
GET /api/v3/whoami HTTP/1.1
Host: app-academy.make.com
authorization: text
Accept: */*