Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

I beebytes kundportal finns ett API för hantering av DNS-pekare.

API nycklar skapas i kundportalen: https://portal.beebyte.se/organisation/apikey/

En API browser finns här: https://portal.beebyte.se/api/v1/

Exempel för användning av APIet:

Lista alla domäner för en organisation

Code Block
languagebash
curl -s -X GET -H "Content-Type: application/json" https://portal.beebyte.se/api/v1/domain/ -H 'API-KEY: MIN-API-NYCKEL' | jq
[
  {
    "name": "example.com",
    "state": "ACTIVE",
    "url": "http://portal.beebyte.se/api/v1/domain/example.com/",
    "records_url": "http://portal.beebyte.se/api/v1/domain/example.com/record/"
  },
]

Lista pekningar för en domän

Code Block
curl -s -X GET -H "Content-Type: application/json" https://portal.beebyte.se/api/v1/domain/example.com/record/ -H 'API-KEY: MIN-API-NYCKEL' | jq
[
  {
    "id": 1594,
    "name": "example.com",
    "ttl": 1800,
    "record_type": "SOA",
    "record_data": "dns01.beebyte.se registry@beebyte.se 65535 7200 65535 3600",
    "locked": true,
    "url": "http://portal.beebyte.se/api/v1/domain/example.com/record/1594/"
  },
  {
    "id": 1595,
    "name": "example.com",
    "ttl": 1800,
    "record_type": "NS",
    "record_data": "dns01.beebyte.se",
    "locked": true,
    "url": "http://portal.beebyte.se/api/v1/domain/example.com/record/1595/"
  },
  {
    "id": 1596,
    "name": "example.com",
    "ttl": 1800,
    "record_type": "NS",
    "record_data": "dns02.beebyte.se",
    "locked": true,
    "url": "http://portal.beebyte.se/api/v1/domain/example.com/record/1596/"
  },
  {
    "id": 1747,
    "name": "example.com",
    "ttl": 1800,
    "record_type": "ALIAS",
    "record_data": "www.beebyte.se",
    "locked": false,
    "url": "http://portal.beebyte.se/api/v1/domain/example.com/record/1747/"
  },
  {
    "id": 3869,
    "name": "example.com",
    "ttl": 1800,
    "record_type": "A",
    "record_data": "185.133.205.36",
    "locked": false,
    "url": "http://portal.beebyte.se/api/v1/domain/example.com/record/3869/"
  },
  {
    "id": 7563,
    "name": "example.com",
    "ttl": 1800,
    "record_type": "MX",
    "record_data": "10 mail1.beebyte.se",
    "locked": false,
    "url": "http://portal.beebyte.se/api/v1/domain/example.com/record/7563/"
  },
  {
    "id": 7564,
    "name": "example.com",
    "ttl": 1800,
    "record_type": "TXT",
    "record_data": "v=spf1 mx a ~all",
    "locked": false,
    "url": "http://portal.beebyte.se/api/v1/domain/example.com/record/7564/"
  },
  {
    "id": 12032,
    "name": "test.example.com",
    "ttl": 30000,
    "record_type": "A",
    "record_data": "1.2.3.4",
    "locked": false,
    "url": "http://portal.beebyte.se/api/v1/domain/example.com/record/12032/"
  }
]

Skapa en DNS pekare, skriv över andra pekare med samma namn och typ

Code Block
curl -s -X POST -H "Content-Type: application/json" https://portal.beebyte.se/api/v1/domain/example.com/record/ -H 'API-KEY: MIN-API-NYCKEL' --data '{"name": "record1.example.com", "ttl": 1800, "record_type": "A", "record_data": "1.2.3.4", "overwrite": true}' | jq
{
  "id": 21576,
  "name": "record1.example.com",
  "ttl": 1800,
  "record_type": "A",
  "record_data": "1.2.3.4",
  "locked": false,
  "url": "http://portal.beebyte.se/api/v1/domain/example.com/record/21576/"
}

Förenklade anrop

Ta bort en DNS pekare baserat på endast namn

Code Block
curl -s -X DELETE -H "Content-Type: application/json" https://portal.beebyte.se/api/v1/domain/record/simple/ -H 'API-KEY: MIN-API-NYCKEL' --data '{"name": "record1.example.com"}' | jq