Create External Service Link

Create an external service link.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating an external service link.

    • typestringRequired

      Provide external service link type. Current selection is only external_service_links.

    • attributesformData, objectRequired

      Attributes object with a few required fields.

      • service_urlstringRequired

        URL for external service

    • relationshipsformData, objectRequired

      Relationships object with business oor external_service objects.

      • businessformData, objectRequired

        Add a relationships link between deliveries and related Business.

        • idstringRequired

          Related Business id.

        • typestring

          Business type; Business.

      • external_serviceformData, objectRequired

        Add a relationships link.

        • idstringRequired

          Related External Service id.

        • typestring

          External Service type; external_service.

POST/api/v1/external_service_links

{
  const res = await fetch(`${BASE_URL}/api/v1/external_service_links`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE

{
  "data": [
    {
      "id": "5f315bfb-642c-4bd6-bb9f-6c9053df02d9",
      "type": "external-services",
      "links": {
        "self": "/external-services/5f315bfb-642c-4bd6-bb9f-6c9053df02d9"
      },
      "attributes": {
        "category": "delivery",
        "logo": {
          "url": "https://foodetective-staging-backend-data.s3.amazonaws.com/uploads/external_service/logo/5f315bfb-642c-4bd6-bb9f-6c9053df02d9/f356f310-bfa9-4583-9a97-5f75ee40f71d.png",
          "thumb": {
            "url": "https://foodetective-staging-backend-data.s3.amazonaws.com/uploads/external_service/logo/5f315bfb-642c-4bd6-bb9f-6c9053df02d9/thumb_f356f310-bfa9-4583-9a97-5f75ee40f71d.png"
          }
        },
        "name": "Deliveroo"
      }
    }
  ],
  "meta": {
    "total-count": 25,
    "total-pages": 13
  }
}

Update External Service Link

Update an external service link.

Parameters
  • idpath integerRequired

    Update a External Service Link by specific link id.

  • dataformData, objectRequired

    Form Data needed when updating a External Service Link.

    • idstringRequired

      Provide External Service Link id.

    • typestringRequired

      Provide External Service Link type. Current selection is only external_service_links.

    • attributesformData, object

      Attributes object.

      • service_urlstring

        URL for external service

PATCH/api/v1/external_service_links/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/external_service_links/${id}`, {
    method: 'PATCH',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE

{
  "data": {
    "id": "5f315bfb-642c-4bd6-bb9f-6c9053df02d9",
    "type": "external-services",
    "links": {
      "self": "/external-services/5f315bfb-642c-4bd6-bb9f-6c9053df02d9"
    },
    "attributes": {
      "category": "delivery",
      "logo": {
        "url": "https://foodetective-staging-backend-data.s3.amazonaws.com/uploads/external_service/logo/5f315bfb-642c-4bd6-bb9f-6c9053df02d9/f356f310-bfa9-4583-9a97-5f75ee40f71d.png",
        "thumb": {
          "url": "https://foodetective-staging-backend-data.s3.amazonaws.com/uploads/external_service/logo/5f315bfb-642c-4bd6-bb9f-6c9053df02d9/thumb_f356f310-bfa9-4583-9a97-5f75ee40f71d.png"
        }
      },
      "name": "Deliveroo"
    }
  }
}

Delete External Service Link

Delete an external service link.

Parameters
  • idpath integerRequired

    Delete a External Service Link by specific link id.

DELETE/api/v1/external_service_links/{id}

{
  const res = await fetch(`${BASE_URL}/api/v1/external_service_links/${id}`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json'
    }});
  const data = await res.json();
}