Houston I have a problem

Code Samples

Follow

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" using template "Example Template"

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", "template":"Example Template"}}'

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 "example.com" 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/example.com -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 for zone "example.com" 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/example.com/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",
              "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",
              "ttl": 3600,
              "zone_id": 1
        }
  }]

Get records for Zone with filters

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?record_type=CNAME&name=www'

Example Response:

  [{
        "zone_record": {
              "name": "www.example.com.",
              "data": "newexample.com",
              "id": 142,
              "aux": null,
              "record_type": "CNAME",
              "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",
              "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",
              "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/example.com/records/141 -X DELETE

Example Response:

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

 

Redirects Examples

Create redirect for zone "example.com" call "site" redirecting to "http://example.com" (type 302)

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/example.com/redirects -d '{"zone_redirect":{"name":"site","redirect_to":"http://example.com","redirect_type":302}}'

Example Response:

  {
        "zone_redirect": {
              "name": "site.example.com.",
              "redirect_to": "http://example.com",
              "id": 3,
              "redirect_type": 302,
              "iframe_title": null,
              "redirect_query_string": false,
              "zone_id": 1
        }
  }

Get redirects 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/redirects

Example Response:

  [{
        "zone_redirect": {
              "name": "site.example.com.",
              "redirect_to": "http://example.com",
              "id": 3,
              "redirect_type": 302,
              "iframe_title": null,
              "redirect_query_string": false,
              "zone_id": 1
        }
  }]

Get redirect 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/redirects/3

Example Response:

  {
        "zone_redirect": {
              "name": "site.example.com.",
              "redirect_to": "http://example.com",
              "id": 3,
              "redirect_type": 302,
              "iframe_title": null,
              "redirect_query_string": false,
              "zone_id": 1
        }
  }

Update redirect with redirect to: "http://example-site.com" (PUT)

curl -u "user@example.com:f9eca287-5346-1cc7-8529-68eb9db7cd5e" -H 'Accept: application/json' -H "Content-type: application/json" https://pointhq.com/zones/example.com/redirects/3 -X PUT -d '{"zone_redirect":{"redirect_to":"http://example-site.com"}}'

Example Response:

  {
        "zone_redirect": {
              "name": "site.example.com.",
              "redirect_to": "http://example-site.com",
              "id": 3,
              "redirect_type": 302,
              "iframe_title": null,
              "redirect_query_string": false,
              "zone_id": 1
        }
  }

Delete redirect (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/redirects/3 -X DELETE

Example Response:

  {
        "zone_redirect": {
              "status": "OK"
        }
  }

 

Mail Redirects Examples

Create mail redirect for zone "example.com" from "admin" to "user@example-site.com"

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

Example Response:

  {
        "zone_mail_redirect": {
              "source_address": "admin",
              "destination_address": "user@example-site.com",
              "id": 5,
              "zone_id": 1
        }
  }

Get mail redirects 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/mail_redirects

Example Response:

  [{
        "zone_mail_redirect": {
              "source_address": "admin",
              "destination_address": "user@example-site.com",
              "id": 5,
              "zone_id": 1
        }
  }]

Get mail redirect 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/mail_redirects/5

Example Response:

  {
        "zone_mail_redirect": {
              "source_address": "admin",
              "destination_address": "user@example-site.com",
              "id": 5,
              "zone_id": 1
        }
  }

Update mail redirect with destination address: "admin@example-site.com" (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/mail_redirects/5 -X PUT -d '{"zone_mail_redirect":{"destination_address":"admin@example-site.com"}}'

Example Response:

  {
        "zone_mail_redirect": {
              "source_address": "admin",
              "destination_address": "admin@example-site.com",
              "id": 5,
              "zone_id": 1
        }
  }

Delete mail redirect (DELETE)

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

Example Response:

  {
        "zone_mail_redirect": {
              "status": "OK"
        }
  }
Was this article helpful?
0 out of 0 found this helpful

Comments