Difference between revisions of "DNS API"
From CMU ITSC Network
(Created page with "Hello") |
|||
Line 1: | Line 1: | ||
− | + | == Authentication == | |
+ | Authenticate with CMU Oauth to get authorization key then use as "bearer token" in "Authorization" Header on every request. | ||
+ | |||
+ | == End Point == | ||
+ | === List domain === | ||
+ | List domain that authenticated user has permission.<br> | ||
+ | '''Request''' | ||
+ | <syntaxhighlight> | ||
+ | GET /domains HTTP/1.1 | ||
+ | Host: dns-api.cmu.ac.th | ||
+ | Authorization: Bearer hKm1BTuXj4U7rGChx1eWKSb8bc6Wx1uz | ||
+ | </syntaxhighlight> | ||
+ | '''Response''' | ||
+ | <syntaxhighlight> | ||
+ | [ | ||
+ | { | ||
+ | "domain": "cnoc.cmu.ac.th" | ||
+ | }, | ||
+ | { | ||
+ | "domain": "eng.cmu.ac.th" | ||
+ | }, | ||
+ | { | ||
+ | "domain": "reg.cmu.ac.th" | ||
+ | } | ||
+ | ] | ||
+ | </syntaxhighlight> |
Revision as of 09:26, 6 May 2018
Authentication
Authenticate with CMU Oauth to get authorization key then use as "bearer token" in "Authorization" Header on every request.
End Point
List domain
List domain that authenticated user has permission.
Request
GET /domains HTTP/1.1
Host: dns-api.cmu.ac.th
Authorization: Bearer hKm1BTuXj4U7rGChx1eWKSb8bc6Wx1uz
Response
[
{
"domain": "cnoc.cmu.ac.th"
},
{
"domain": "eng.cmu.ac.th"
},
{
"domain": "reg.cmu.ac.th"
}
]