A pact between GDS API Adapters and Link Checker API

Requests from GDS API Adapters to Link Checker API

Interactions

Upon receiving the request to check a URI from GDS API Adapters, with

{
  "method": "get",
  "path": "/check",
  "query": "uri=https%3A%2F%2Fwww.gov.uk",
  "headers": {
    "Accept": "application/json",
    "User-Agent": "gds-api-adapters/75.3.0 ()"
  }
}

Link Checker API will respond with:

{
  "status": 200,
  "headers": {
    "Content-Type": "application/json; charset=utf-8"
  },
  "body": {
    "uri": "https://www.gov.uk",
    "status": "pending",
    "checked": null,
    "errors": [

    ],
    "warnings": [

    ],
    "problem_summary": null,
    "suggested_fix": null
  }
}

Upon receiving the request to create a batch from GDS API Adapters, with

{
  "method": "post",
  "path": "/batch",
  "headers": {
    "Accept": "application/json",
    "User-Agent": "gds-api-adapters/75.3.0 ()",
    "Content-Type": "application/json"
  },
  "body": {
    "uris": [
      "https://www.gov.uk"
    ]
  }
}

Link Checker API will respond with:

{
  "status": 202,
  "headers": {
    "Content-Type": "application/json; charset=utf-8"
  },
  "body": {
    "id": 1,
    "status": "in_progress",
    "links": [
      {
        "uri": "https://www.gov.uk",
        "status": "pending"
      }
    ]
  }
}

Given a batch exists with id 99 and uris https://www.gov.uk, upon receiving the request to get a batch from GDS API Adapters, with

{
  "method": "get",
  "path": "/batch/99",
  "headers": {
    "Accept": "application/json",
    "User-Agent": "gds-api-adapters/75.3.0 ()"
  }
}

Link Checker API will respond with:

{
  "status": 200,
  "headers": {
    "Content-Type": "application/json; charset=utf-8"
  },
  "body": {
    "id": 99,
    "status": "in_progress",
    "links": [
      {
        "uri": "https://www.gov.uk",
        "status": "pending"
      }
    ]
  }
}