You need credentials to interact with the APIAfter creating an account we will securely provide you with a client_id and
client_secret pair. At this moment you cannot sign up online.
To begin building with the Gridshare API, reach out to support at [email protected].
If you are already connected with the team and ready to begin, follow the Authentication steps below.
Getting Started
Gridshare API uses OAuth 2.0 client access tokens for authentication.
A Bearer token can be obtained from our Authentication Endpoint. This token must
be sent to Gridshare API in an Authorization header in subsequent requests to
validate yourself.
| Authentication Endpoint | |
|---|---|
| Production (USA) | gridshare-partner-prod-us-west-1.auth.us-west-1.amazoncognito.com |
| Production (rest of world) | gridshare-partner.auth.eu-west-1.amazoncognito.com |
| Development (USA) | gridshare-partner-dev-us-west-1.auth.us-west-1.amazoncognito.com |
| Development (rest of world) | test-partner-portal-1.auth.eu-west-1.amazoncognito.com |
| API Base URL | |
|---|---|
| Production (USA) | developer-api.partner.us.mygridshare.com |
| Production (rest of world) | developer-api.partner.mygridshare.com |
| Development (USA) | developer-api.partner.dev0.us.mygridshare.com |
| Development (rest of world) | developer-api.partner.dev0.mygridshare.com |
Getting an Authorization token
curl -s -X POST --user "${client_id}:${client_secret}" \
-H 'Content-Type: application/x-www-form-urlencoded' \
"https://${authentication_endpoint}/oauth2/token?grant_type=client_credentials"The response contains a JSON object with an access_token that needs to be sent
back as Bearer in the Authorization header for each request to the API. The
access_token has an expiration time (1 hour in this example) after which a new
token has to be requested from the Authentication endpoint.
{
"access_token": "eyJraWQiOiJ ... 5oIrG-ReOwqLAqAV1s2w",
"expires_in": 3600,
"token_type": "Bearer"
}Sending API requests
curl -s -H "Authorization: Bearer ${access_token}" "https://${api_base_url}/api/v1/sites"
# API Response in JSON format