Getting connected

Getting connected

Request flow

  1. Obtain an authorization token from the AuthToken endpoint (see below)

  2. Supply an Authorization header with content Bearer followed by the token obtained in step 1.

Example:

curl -D- -X GET -H "Authorization: Bearer {token}" -H "Content-Type: application/json" "https://m.fascard.com/api/Machine"

Token expiration

Note that a token will expire after some period of time.  If you send a request with an expired token then we will return a 401 Unauthorized (= unauthenticated), and in that case you can simply resubmit the username and password to the AuthToken endpoint to request a new token.


Obtain Token

Pass username and password as body to API GET call:

Request body

{ "UserName": "myfascardlogin@email.com", "Password": "myPassword123!" }

Field Name

Type

Description

Field Name

Type

Description

UserName

string

Email address of user

Password

string

Password of user

Response

The response will be a unique token identifier for your user/password login:

Example return of AuthToken
{ "Token": "abcdefghijklmnopqrstuvwxyz" }

Field Name

Type

Description

Field Name

Type

Description

Token

string

The authorization token used with subsequent API calls.

See Error Handling

POST /api/AuthToken