---
title: Search for a Supplier
slug: docs/demo/search-for-a-supplier
description: Learn how to make a GET request using curl and retrieve information from a fictive API with this helpful code example. Includes the necessary headers for accepting and sending JSON data. Improve your understanding of API integration and efficient data ret
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "GWBV1j3keecSZ0g2h3gZU",
  "data": {
    "url": "https://api.fictive.com/REST/api/suppliers",
    "name": "Search for a Supplier",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "name",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "status",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "contactPhone",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "contactEmail",
          "type": "string"
        }
      ],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "schema": [
              {
                "kind": "optional",
                "name": "supplierReference",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "name",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "contactEmail",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "contactPhone",
                "type": "string",
                "example": ""
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.SupplierResponse",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.SupplierResponse[]",
            "isExpanded": true
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "[\n  {\n    \"supplierReference\": \"001SUHVU1CNM5CUAR3\",\n    \"name\": \"Supplier 1\",\n    \"status\": \"Active\",\n    \"contactEmail\": \"supplier1@test.com\",\n    \"contactPhone\": \"0111 222 3333\"\n  },\n  {\n    \"supplierReference\": \"001SUVNW1FXEIO94C2\",\n    \"name\": \"Supplier 2\",\n    \"status\": \"Inactive\",\n    \"contactEmail\": \"supplier2@test.com\",\n    \"contactPhone\": \"0111 222 4444\"\n  }\n]"
      },
      {
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "schema": [
              {
                "kind": "optional",
                "name": "supplierReference",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "name",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "contactEmail",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "contactPhone",
                "type": "string",
                "example": ""
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.SupplierResponse",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.SupplierResponse[]",
            "isExpanded": true
          }
        ],
        "isExpanded": true,
        "statusCode": "204",
        "description": "No Content",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Bad request",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "Calling this endpoint will retrieve a set of Suppliers",
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/suppliers \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/suppliers\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/suppliers\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/suppliers\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "[\n  {\n    \"supplierReference\": \"001SUHVU1CNM5CUAR3\",\n    \"name\": \"Supplier 1\",\n    \"status\": \"Active\",\n    \"contactEmail\": \"supplier1@test.com\",\n    \"contactPhone\": \"0111 222 3333\"\n  },\n  {\n    \"supplierReference\": \"001SUVNW1FXEIO94C2\",\n    \"name\": \"Supplier 2\",\n    \"status\": \"Inactive\",\n    \"contactEmail\": \"supplier2@test.com\",\n    \"contactPhone\": \"0111 222 4444\"\n  }\n]"
        },
        {
          "id": "response-1-204",
          "language": "204",
          "code": "// No Content\n[\n  {\n    \"supplierReference\": \"\",\n    \"name\": \"\",\n    \"status\": \"\",\n    \"contactEmail\": \"\",\n    \"contactPhone\": \"\"\n  }\n]"
        },
        {
          "id": "response-2-400",
          "language": "400",
          "code": "// Bad request\n"
        },
        {
          "id": "response-3-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}