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:
Environment | GraphQL API Endpoint |
---|---|
Development | https://api.dev.abralife.com/graphql |
Preproduction | https://api.preprod.abralife.com/graphql |
Production | https://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
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.
Add the JWT Token:
- Include the JWT token in the
Authorization
header of your request, using theBearer
scheme:
Authorization: Bearer <your-jwt-token>
- Include the JWT token in the
Set the Query:
- Add your GraphQL query in the body section, similar to the example shown below.
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
Troubleshooting
- Invalid Credentials: If you receive an error indicating invalid credentials, verify that your JWT token has the necessary permissions.
- Environment-Specific Issues: Double-check that you’re using the correct API endpoint for each environment.
- 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.