Services API

Service attributes

Please refer to the definition of the Service data type in our OpenAPI documentation.

Service Setting attributes

Please refer to the definition of the ServiceSetting data type in our OpenAPI documentation.

List services

GET /services

Sorting

For general information about sorting, please refer to the main guide.

Name Description
id Sort services by ID
sid Sort services by string ID (alphabetical order)

The default sorting policy is by ascending id.

Example

List all services.

curl -H 'Authorization: Bearer <token>' \
     -H 'Accept: application/json' \
     https://api.dnsimple.com/v2/services

Response

Responds with HTTP 200 on success.

{
  "data": [
    {
      "id": 1,
      "name": "Service 1",
      "sid": "service1",
      "description": "First service example.",
      "setup_description": null,
      "requires_setup": false,
      "default_subdomain": null,
      "created_at": "2014-02-14T19:15:19Z",
      "updated_at": "2016-03-04T09:23:27Z",
      "settings": [

      ]
    },
    {
      "id": 2,
      "name": "Service 2",
      "sid": "service2",
      "description": "Second service example.",
      "setup_description": null,
      "requires_setup": true,
      "default_subdomain": null,
      "created_at": "2014-02-14T19:15:19Z",
      "updated_at": "2016-03-04T09:23:27Z",
      "settings": [
        {
          "name": "username",
          "label": "Service 2 Account Username",
          "append": ".service2.com",
          "description": "Your Service2 username is used to connect services to your account.",
          "example": "username",
          "password": false
        }
      ]
    }
  ],
  "pagination": {
    "current_page": 1,
    "per_page": 30,
    "total_entries": 2,
    "total_pages": 1
  }
}

Errors

Responds with HTTP 401 in case of case of authentication issues.

Retrieve a service

GET /services/:service

Parameters

Name Type Description
:service string, integer The service name or id

Example

Get the service with ID 1.

curl -H 'Authorization: Bearer <token>' \
     -H 'Accept: application/json' \
     https://api.dnsimple.com/v2/services/1

Response

Responds with HTTP 200 on success.

{
  "data": {
    "id": 1,
    "name": "Service 1",
    "sid": "service1",
    "description": "First service example.",
    "setup_description": null,
    "requires_setup": true,
    "default_subdomain": null,
    "created_at": "2014-02-14T19:15:19Z",
    "updated_at": "2016-03-04T09:23:27Z",
    "settings": [
      {
        "name": "username",
        "label": "Service 1 Account Username",
        "append": ".service1.com",
        "description": "Your Service 1 username is used to connect services to your account.",
        "example": "username",
        "password": false
      }
    ]
  }
}

Errors

Responds with HTTP 401 in case of case of authentication issues.