Methods

Foo API is uses a REST architectural style. In the future we may add more interfaces, but the REST interface will be the original source of truth.

Page

A page is a URL stored in a user account with associated data. Audits run against pages (URLs).

findAll

GET https://www.foo.software/api/v1/pages
Finds all pages of an authorized account.
Authentication required? Yes
Example
curl -X GET "https://www.foo.software/api/v1/pages" -H "accept: application/json" -H "Authorization: 5c811cb64cffeb004686508c_4eba9321-c59b-497c-92ee-7397be3a589d"

Example response body

{
  "status": 200,
  "code": "SUCCESS_GENERIC",
  "message": "Success!",
  "namespace": "route/Page/publicFindAll",
  "data": {
    "page": [
      {
        "accountId": "5c811cb64cffeb004686508c",
        "name": "Foo",
        "regionId": "us-east-1",
        "url": "https://www.foo.software"
      }
    ]
  }
}

Queue

Lighthouse and Puppeteer browser runs are organized in a queue - a first-in-first-out data structure as described in Wikipedia. By adding to the queue - you can enqueue pages to be audited by Lighthouse for example. API rate limits are on a per page basis, defined by account type. You can find your limit in account management or see all of them in the Plans and Pricing page.

addItems

POST https://www.foo.software/api/v1/queue/items
Adds a page or group of pages to the browser run queue. Each page requires a API token. You can find the token when logged in via the dashboard for the corresponding page.
Authentication required? No
Payload
Name Description Type Required Default
pages A comma separated list of page api tokens found in the dashboard - one for each page to be enqueued. You can also just provide one. String Yes --
tag An optional tag or name of a performance run (example: build #2 or v0.0.2). String Yes --
Example
curl -X POST "https://www.foo.software/api/v1/queue/items" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"pages\": \"pagetoken1,pagetoken2\", \"tag\": \"build 3\" }"

Example response body

{
  "status": 200,
  "code": "SUCCESS_GENERIC",
  "message": "Success!",
  "namespace": "Route:addQueueItemsPublicApi()",
  "data": {
    "queue": {
      "results": [
        {
          "code": "SUCCESS_QUEUE_ADD",
          "message": "Added to the queue!",
          "status": 200
        },
        {
          "code": "ERROR_PAGE_MISSING",
          "message": "This page does not exist.",
          "status": 422
        }
      ],
      "errors": 1
    }
  }
}

results matching ""

    No results matching ""