Report this

What is the reason for this report?

What is the proper way to request "List All Domain Records" from the API?

Posted on November 9, 2015

I’m using the following code (with my respective API key and domain) to make a request to get all domain records. The problem is that I don’t get back my domain records, instead, I get the Digital Ocean domain records. I have made other requests using my domain and API key and got back correct information. What part of this request is causing me to not get back my domain records?

This is my request:

curl -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer MY_API_KEY' "https://api.digitalocean.com/v2/domains/MYDOMAIN.com/records" 

This is my output:

{
    "domain_records": [
        {
            "id": 9663214,
            "type": "NS",
            "name": "@",
            "data": "ns1.digitalocean.com",
            "priority": null,
            "port": null,
            "weight": null
        },
        {
            "id": 9663215,
            "type": "NS",
            "name": "@",
            "data": "ns2.digitalocean.com",
            "priority": null,
            "port": null,
            "weight": null
        },
        {
            "id": 9663216,
            "type": "NS",
            "name": "@",
            "data": "ns3.digitalocean.com",
            "priority": null,
            "port": null,
            "weight": null
        },
        {
            "id": 9663217,
            "type": "A",
            "name": "@",
            "data": "159.203.105.142",
            "priority": null,
            "port": null,
            "weight": null
        },
        {
            "id": 9687584,
            "type": "MX",
            "name": "@",
            "data": "@",
            "priority": 5,
            "port": null,
            "weight": null
        }
    ],
    "links": {

    },
    "meta": {
        "total": 5
    }
}

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.