Connecting to Your GraphQL

Updated 2 weeks ago ​by nussi

The GraphQL API is pending roll out.

Endpoint

Available on https://SERVER.api.sellercloud.com/gql where SERVER corresponds to your own.

Swagger

On the https://SERVER.api.sellercloud.com/gql/swagger endpoint you can use the SwaggerUI to query the API directly. Remember to replace SERVER with the name of your own server.

Authorization

In order to be able to poll the endpoint you need to be authorized.

  • Swagger

If you are using Swagger, expand the /token section and click on the Try it Out button to the right. In the text box, type in a valid username and password combination and click EXECUTE. If your credentials are valid you will see a response similar to the following:

{
"token_type": "Bearer",
"access_token": "ACCESS_TOKEN_HERE",
"validFrom": "2019-05-03T10:52:41Z",
"validTo": "2019-06-02T10:52:41Z"
}

Copy the value of the access_token property.

Click on the Authorize button at the top right of the page and in the input box type in Bearer (with a trailing space) and then paste the token from above. Click Authorize and you should see an "Authorized" message. Close the box and you can now send GraphQL queries to the /graphql endpoint.

  • Manually

Similarly to Swagger, you first need to make a request to the /token API and obtain the access_token. Then in each request to the /graphql endpoint you need to include an Authorization header:

Authorization: Bearer ACCESS_TOKEN_HERE

Examples

You can view sample code snippets here.


How did we do?