List host groups
1 min
code examples curl request get \\ \ url 'https //openapi sine co/v1/api/hosts/groups?limit=100' \\ \ header 'accept application/json' \\ \ header 'x sine team id string\<uuid>'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("x sine team id", "string\<uuid>"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("https //openapi sine co/v1/api/hosts/groups?limit=100", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));import requests import json url = "https //openapi sine co/v1/api/hosts/groups?limit=100" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json', 'x sine team id' 'string\<uuid>' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses // ok request completed successfully the first page of host groups matching the query parameters (if specified) will be included in the response { "records" \[ { "id" "ecbc5ca7 d6e1 4133 90a0 e7070d993f18", "name" "host group name", "private" false, "site" { "id" "", "name" "site name" } } ], "next" "dghpcyb0b2tlbibpcybvcgfxdwusigrvbid0ihryesb0bybkzwnvzgugaxq=" }// bad request { "code" "bad request", "message" "the request is invalid" }// unauthorized { "code" "unauthorized", "message" "invalid authentication credentials" }// forbidden { "code" "forbidden", "message" "you are not allowed to access this information" }// resource not found { "code" "site not found", "message" "sitenotfounderror" }// service dependency failed { "code" "consumer error", "message" "unexpected error while communicating with downstream service, please try again" }// too many requests { "code" "rate limited", "message" "api rate limit exceeded" }// internal server error { "code" "internal server error", "message" "something went wrong, please try again later" }