Last updated

Getting Started

Welcome to the Abra Cloud API! This guide will give you an overview of fetching homes details from the Abra Cloud Platform. You’ll learn how to set up authentication, handle multiple environments, and make your first homes query.


Prerequisites

Before you begin, ensure you have the following credentials and tokens:

  • JWT Token: Required for Authentication.

Each environment may use different API endpoints, so confirm the correct endpoint for each environment you’re working in.

Authentication

To use the Abra APIs you need to access the app client and client secret. These are needed to request JWT token from our platform.

Environments

Abra Cloud provides separate environments for development, preproduction, and production. Each environment has a unique API endpoint:

EnvironmentGraphQL API Endpoint
Developmenthttps://api.dev.abralife.com/graphql
Preproductionhttps://api.preprod.abralife.com/graphql
Productionhttps://api.prod.abralife.com/graphql

Use the correct endpoint according to your development stage.

Calling the API

To make requests to the Abra Cloud API, use a tool that supports AWS authentication, such as Postman, ThunderClient, curl, or your codebase with AWS SDK.

For Authentication

  1. Obtain the JWT Token:

    • Sign in the user to receive a JWT token. This can be done programmatically or by having the user log in through your application.
  2. Add the JWT Token:

    • Include the JWT token in the Authorization header of your request, using the Bearer scheme:
    Authorization: Bearer <your-jwt-token>
    
  3. Set the Query:

    • Add your GraphQL query in the body section, similar to the example shown below.
  4. Send the Request:

    • Use the appropriate endpoint and include the JWT token in the request header.

Sample Request

Here’s a sample curl command for making a homes query. Replace the placeholder values with actual token and environment-specific endpoint:

curl -X POST <environment-api-endpoint>/graphql \
  -H "Authorization: Bearer <your-jwt-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query homes{homes {id}}"
  }'
  • ThunderClient

img alt jwt


Troubleshooting

  1. Invalid Credentials: If you receive an error indicating invalid credentials, verify that your JWT token has the necessary permissions.
  2. Environment-Specific Issues: Double-check that you’re using the correct API endpoint for each environment.
  3. Token Expiration: JWT tokens expire after a set time, so you may need to refresh the token periodically.

For more details on setting up, please see our Authentication Guide and Error Handling Guide.