# Get agency GET https://hublinks.io/rest/agency/{agency_id} Retrieve agency details. Reference: https://api.hublinks.io/api-reference/agency/get-agency ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /rest/agency/{agency_id}: get: operationId: get-agency summary: Get agency description: Retrieve agency details. tags: - subpackage_agency parameters: - name: agency_id in: path required: true schema: type: string - name: specific_attributes in: query description: >- Comma-separated list of attributes to return. Any combination of: `accounts`, `agency_id`, `active_until`, `name`, `seats_assigned`, `seats_paid`, `seats_used`, `status`, `stripe_customer_id`, `subscription_status`, `created_at`, `created_by`. required: false schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/Agency_Get agency_Response_200' servers: - url: https://hublinks.io components: schemas: RestAgencyAgencyIdGetResponsesContentApplicationJsonSchemaAgency: type: object properties: accounts: type: array items: type: string agency_id: type: string active_until: type: string name: type: string seats_assigned: type: integer seats_paid: type: integer seats_used: type: integer status: type: string subscription_status: type: string created_at: type: integer created_by: type: string required: - accounts - agency_id - active_until - name - seats_assigned - seats_paid - seats_used - status - subscription_status - created_at - created_by title: RestAgencyAgencyIdGetResponsesContentApplicationJsonSchemaAgency Agency_Get agency_Response_200: type: object properties: success: type: boolean agency: $ref: >- #/components/schemas/RestAgencyAgencyIdGetResponsesContentApplicationJsonSchemaAgency required: - success - agency title: Agency_Get agency_Response_200 securitySchemes: apiKeyAuth: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Response import requests url = "https://hublinks.io/rest/agency/agency_id" headers = {"X-API-KEY": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript Response const url = 'https://hublinks.io/rest/agency/agency_id'; const options = {method: 'GET', headers: {'X-API-KEY': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Response package main import ( "fmt" "net/http" "io" ) func main() { url := "https://hublinks.io/rest/agency/agency_id" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-API-KEY", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Response require 'uri' require 'net/http' url = URI("https://hublinks.io/rest/agency/agency_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-API-KEY"] = '' response = http.request(request) puts response.read_body ``` ```java Response import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://hublinks.io/rest/agency/agency_id") .header("X-API-KEY", "") .asString(); ``` ```php Response request('GET', 'https://hublinks.io/rest/agency/agency_id', [ 'headers' => [ 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Response using RestSharp; var client = new RestClient("https://hublinks.io/rest/agency/agency_id"); var request = new RestRequest(Method.GET); request.AddHeader("X-API-KEY", ""); IRestResponse response = client.Execute(request); ``` ```swift Response import Foundation let headers = ["X-API-KEY": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://hublinks.io/rest/agency/agency_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```