😄Use API key

Making a POST request to the Phi.Blue GraphQL API by API-key

In this guide, we will walk through the process of sending a POST request to the Phi.Blue GraphQL API at https://graph-api.phi.blue/graphql.

Prerequisites

To use the Phi.Blue GraphQL API, you need to have your API key. This API key should be included in the header of your request.

Preparing the Request

For our example, we will use the philandList query. Below are the required steps:

  1. URL: The URL for the GraphQL endpoint is https://graph-api.phi.blue/graphql.

  2. Headers: You will need to specify the headers for your request. These should include your x-api-key and Content-Type. Here's an example:

{
  "x-api-key": "<YOUR-API-KEY>",
  "Content-Type": "application/json"
}

Replace <YOUR-API-KEY> with your actual API key.

  1. Body: In the body of your request, you should include your GraphQL query.

For this example, we will use the philandList query. Here's what that would look like:

{
  "query": "query philandList { 
  philandList
    (input: 
      {address: \"0x5037e7747fAa78fc0ECF8DFC526DcD19f73076ce\", transparent: false}) 
        { data { name landurl imageurl } 
      } 
    "
}

Sending the Request

Once you have prepared your URL, headers, and body, you are ready to send your request. You can use tools like curl, Postman, or any programming language with HTTP capabilities (like Python, JavaScript, etc.) to make your request.


Last updated