NAV Navbar
Logo
cURL PHP Ruby Python

Introduction

API libraries

Official libraries for the Plagly API are available in several languages. Community-supported libraries are also available for additional languages.

API Endpint: https://api.plagly.com

The Plagly API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website’s client-side code). JSON is returned by all API responses, including errors, although our API libraries convert responses to appropriate language-specific objects.

The requests in the right sidebar are designed to work as is. The sample requests are performed using a test mode API key, cfzxIJcfztfuNOwDAskO62AOIJcfzxJrc, linked to your account under your email address. Only you can see these account-specific values.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "https://api.plagly.com"
  -H "X-Plagly-Token: cfzxIJcfztfuNOwDAskO62AOIJcfzxJrc"
<?php

Make sure to replace cfzxIJcfztfuNOwDAskO62AOIJcfzxJrc with your API key.

Plagly uses API keys to allow access to the API. You can register a new Plagly API key at our developer portal.

Plagly expects for the API key to be included in all API requests to the server in a header that looks like the following:

X-Plagly-Token: cfzxIJcfztfuNOwDAskO62AOIJcfzxJrc

Errors

The Plagly API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your API key is wrong
403 Forbidden – The request is hidden for administrators only
404 Not Found – The specified request could not be found
405 Method Not Allowed – You tried to access a url with an invalid method
406 Not Acceptable – You requested a format that isn’t json
410 Gone – The request has been removed from our servers
418 I’m a teapot
429 Too Many Requests – You’re requesting toooften! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.

Status

Get API Status

curl -H "Content-Type: application/json;" \
  -H "X-Cachet-Token: YOUR_API_TOKEN" \
  "https://status.plagly.com/api/v1/ping"

Example Response:

{
  "data":"Pong!"
}

This endpoint retrieves API status of the status page.

HTTP Request

GET https://status.plagly.com/api/v1/ping

Query Parameters

None

Get All Services

curl -H "Content-Type: application/json;" \
  -H "X-Cachet-Token: YOUR_API_TOKEN" \
  "https://status.plagly.com/api/v1/components"

Example Response:

{
  "meta": {
    "pagination": {
      "total": 4,
      "count": 4,
      "per_page": 20,
      "current_page": 1,
      "total_pages": 1,
      "links": {
        "next_page": null,
        "previous_page": null
      }
    }
  },
  "data": [
    {
      "id": 1,
      "name": "API",
      "description": "Used by third party apps",
      "link": "",
      "status": 1,
      "order": 3,
      "group_id": 1,
      "enabled": true,
      "created_at": "2017-02-15 22:38:13",
      "updated_at": "2017-02-15 22:53:40",
      "deleted_at": null,
      "status_name": "Operational",
      "tags": {
        "_empty_": ""
      }
    },
    {
      "id": 2,
      "name": "Developer",
      "description": "Dashboard for third party developers",
      "link": "",
      "status": 1,
      "order": 2,
      "group_id": 2,
      "enabled": true,
      "created_at": "2017-02-15 22:38:49",
      "updated_at": "2017-02-15 22:58:20",
      "deleted_at": null,
      "status_name": "Operational",
      "tags": {
        "_empty_": ""
      }
    },
    {
      "id": 3,
      "name": "Browser Extension",
      "description": "Chrome\/Firefox browser plugin",
      "link": "",
      "status": 1,
      "order": 4,
      "group_id": 1,
      "enabled": true,
      "created_at": "2017-02-15 22:39:26",
      "updated_at": "2017-02-15 23:00:01",
      "deleted_at": null,
      "status_name": "Operational",
      "tags": {
        "_empty_": ""
      }
    },
    {
      "id": 4,
      "name": "App",
      "description": "Core web app for browsers and clients",
      "link": "",
      "status": 1,
      "order": 1,
      "group_id": 2,
      "enabled": true,
      "created_at": "2017-02-15 22:50:02",
      "updated_at": "2017-02-15 22:58:08",
      "deleted_at": null,
      "status_name": "Operational",
      "tags": {
        "_empty_": ""
      }
    }
  ]
}

This endpoint retrieves a specific service.

HTTP Request

GET https://status.plagly.com/api/v1/components

URL Parameters

None