B

Point API documentation

Introduction

Point provides an API that gives access to point zone & records management. The API is built using RESTful principles. There is Ruby gem available https://github.com/copper/point

XML and JSON are supported as responses to API calls.


Version

The current version is 1.0.


Authentication

Authentication is currently done with HTTP Basic Authentication. To access your Point account, you'll need to define your username & password. The username is your email address and the password is the API token which, can be found in My Account tab.

username = "user@example.com"
password = "f9eca287-5346-1cc7-8529-68eb9db7cd5e"


Response Codes

We return the following response codes:

Response Code Description
200 Success Everything went fine.
201 Created Everything went fine.
202 Accepted Everything went fine.
403 Forbidden You tried to access something you did not have permissions to.
422 Unprocessable Entity You tried to create or update an object with invalid data.
404 Not Found You tried to access an object that does not exist in your account.
500 Internal Server Error Oops. Something went wrong on our end. Don't worry, we're on the case!

Resources

Currently Point API provides access to Zone and Zone Records resources:


Zone

URI:  pointhq.com/zones

Zones Resource allows you to create, update, delete your zones. It also provides possibility to retrieve single zone or full Zones list.

Property Type Description
id integer The ID of the zone.
name string The domain name.
ttl integer Zone TTL (defaults to 3600).
group string The group this zone belongs to.
user-id integer The ID of the user who created it (this will be you).

See code samples


ZoneRecord

URI:  pointhq.com/zones/ZONE_ID/records

ZoneRecord enables you to manage records in your zones by creating, updating and deleting them. You also can list all your records in particular zone.

Property Type Description
id integer The record ID.
name string The FQDN for the record.
data string The data field.
ttl integer (not used).
aux string The AUX data for the domain (used on MX records).
zone_id integer The ID of the zone.

See code samples.


Code Samples


Curl Command Line

Curl is the quickest way to try Point API. Full documentation on curl can be found here.


Zones Example

Create a zone called "example.com" in "Default Group"

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones -d '{"zone":{"name":"example.com","group":"Default Group"}}'

Example Response:

  {
        "zone": {
              "id": 1,
              "name": "example.com",
              "group": "Default Group",
              "user-id": 3,
              "ttl": 3600
        }
  }

Get Zones

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones

Example Response:

  [{
        "zone": {
              "id": 1,
              "name": "example.com",
              "group": "Default Group",
              "user-id": 3,
              "ttl": 3600
        }
  }]

Get Zone

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/1

Example Response:

  {
        "zone": {
              "id": 1,
              "name": "example.com",
              "group": "Default Group",
              "user-id": 3,
              "ttl": 3600
        }
  }

Update a zone and change its group to "Other Group" (PUT)

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/1 -X PUT -d '{"zone":{"group":"Other Group"}}'

Example Response:

  {
        "zone": {
              "id": 1,
              "name": "example.com",
              "group": "Other Group",
              "user-id": 3,
              "ttl": 3600
        }
  }

Delete zone

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/1 -X DELETE

Example Response:

  "zone": {
        "status": "OK"
  }

Records Examples

Create record called "site" with record type "A", data "1.2.3.4" and TTL 3600

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/1/records -d '{"zone_record":{"name":"site","record_type":"A","data":"1.2.3.4","ttl":3600}}'

Example Response:

  {
        "zone_record": {
              "name": "site.example.com.",
              "data": "1.2.3.4",
              "id": 141,
              "aux": null,
              "record_type": "A",
              "redirect_to": null,
              "ttl": 3600,
              "zone_id": 1
        }
  }

Get records for Zone

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/1/records

Example Response:

  [{
        "zone_record": {
              "name": "site.example.com.",
              "data": "1.2.3.4",
              "id": 141,
              "aux": null,
              "record_type": "A",
              "redirect_to": null,
              "ttl": 3600,
              "zone_id": 1
        }
  }]

Get record using its ID

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/1/records/141

Example Response:

  {
        "zone_record": {
              "name": "site.example.com.",
              "data": "1.2.3.4",
              "id": 141,
              "aux": null,
              "record_type": "A",
              "redirect_to": null,
              "ttl": 3600,
              "zone_id": 1
        }
  }

Update record with data: "1.2.3.5" (PUT)

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/1/records/141 -X PUT -d '{"zone_record":{"data":"1.2.3.5"}}'

Example Response:

  {
        "zone_record": {
              "name": "site.example.com.",
              "data": "1.2.3.5",
              "id": 141,
              "aux": null,
              "record_type": "A",
              "redirect_to": null,
              "ttl": 3600,
              "zone_id": 1
        }
  }

Delete record (DELETE)

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/1/records/141 -X DELETE

Example Response:

  {
        "zone_record": {
              "status": "OK"
        }
  }