1. Introduction

With MyQ REST API, you can generate a new card id for a user that can then be used to log into your custom application or MyQ system. This is usually done when user is registering into the system and need an card id to access his/her account.

2. Prerequisites

REST API application in MyQ → Settings → External Systems has to have access to scope called Users.

3. Calling the API

The endpoint we will in this guide is defined as:

Endpoint:
POST /users/{id}/cards

Authentication:
Type: client
Scopes: [ users ]

Headers:
Content-Type: application/json
Authentication: Bearer %access_token%

Body: 
{}
CODE

Note that the %access_token% needs to be replaced by the token you received as a response from auth endpoint.

In the body and one required parameter in the endpoint path called {id}.

This is the id of a MyQ user. This id can be requested in multiple ways from the MyQ server. We will show how to do this in the guide Searching for a user id.

4. Response

Code:
2xx

Response:
{
	"card": string
}
CODE

If the endpoint was called correctly with correct parameters. The response code should be 2xx and the body should include a JSON with the newly generated card.