Getting Started
To get started with PulseAPI, you will need the username and password provided to you when your account was created.
First time login via API
The /auth/login endpoint allows users to log in by providing their email and password. Upon successful authentication, it typically returns a token that can be used for subsequent requests.
Auth Login
POST /auth/login
The request body should be a JSON object with the following fields:
email(string): The user’s email address.password(string): The user’s password.
Example Payload
{ "email": "user@email.com", "password": "password"}Example Response
{ "id": 1, "email": "user@email.com". ... "token": "asd90f87asdf987asdf987asd"}For info on the full response payload see User Session Props
Example Request using playground
Output:
Using the Token
You can see in the response from /auth/login there is a token property.
This is the Bearer token we can use in our Authorization header to perform
requests against the PulseAPI.
Let’s hit the /auth/session endpoint with our fresh token.
Get Session
GET /auth/session
Output:
Session Response
You can see the response we get is identical to the response we receive during login. This is intentional. Hitting the auth endpoint is designed for clients to be able to get info about the user making the request and their current permissions.
For info on the full response payload see User Session Props