Operator API Collections

Here you can download pre-written GraphQL Queries and Mutations for both Postman and Insomnia API clients

Intro

The Marketplacer Operator API collections have been provided to get developers new to Markerplacer up and running quickly with the Operator API by providing a curated set of the most commonly used queries and mutations. Collections have been provided for both Postman and Insomnia.

Downloads

When developing against the Operator API, you can use a number of different API Test clients to make your life easier, for example:

We have created API collections for both Postman and Insomnia, which can be downloaded below.

Postman

Postman is a tool for developing and testing API integrations. It provides an interface for exploring APIs and executing requests against them. You can download our Postman Collection here.

To import into Postman, download the .json file and go to the import menu in Postman:

Postman Import

Choose the .json file you downloaded and confirm that you wish to import it:

Postman Confirmation

Edit the collection to fill in the variables required to access your site (see the Postman documentation for more information)):

VariableExample value
base_urlhttps://bestfriendbazaar.com/graphql
api_keyYour API key

The collection sends api_key as a Bearer token in the Authorization header.

You will now see a series of requests in Postman which you can study and execute:

Postman Request List


Insomnia

Insomnia is an alternative API client that can be used to run GraphQL queries and mutations in much the same way as Postman. Insomnia is particularly good at working with GraphQL as it ingests the GraphQL schema, enabling it to provide tool-tips, auto-code completion and present the in-line API documentation. Our Insomnia Collection can be downloaded here


To import, click the “Create” button on the Insomnia Dashboard, and select “(Import From) File”:

Import Insomnia Collection


Select the Marketplacer GraphQL API.insomnia_collection.json file you downloaded in the previous step, and click ok. You should see the confirmation once the file has imported:

Import Insomnia Successful


Select the “Marketplacer Collection”

Select Insomnia Collection


We now need to configure the base environment to:

  • Point to your Marketplacer GraphQL API endpoint
  • Use your API Key

To do so, click the Environment drop down, then select Manage Environments:

Manage Environments


You’ll need to provide values for:

  • base_url
  • api_key

The collection sends api_key as a Bearer token in the Authorization header.

An example of what your base environment config should look like is shown below (don’t forget to click “Done” after making any changes):

{
  "base_url": "https://bestfriendbazaar.com/graphql",
  "api_key": "8c1aa7421fd2ea6538763a09b68766d"
}

You should now be able to start using the Insomnia Collection.