# Login POST https://api.xeonda.com/auth/token Content-Type: application/json Exchange your API key and Login ID for a session bearer token. This token must be used for all subsequent authenticated requests. Reference: https://developer.xeonda.com/api-reference/xeonda-api/auth/login ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: Xeonda API version: 1.0.0 paths: /auth/token: post: operationId: login summary: Login description: | Exchange your API key and Login ID for a session bearer token. This token must be used for all subsequent authenticated requests. tags: - subpackage_auth responses: '200': description: Successful Authentication content: application/json: schema: $ref: '#/components/schemas/Auth_login_Response_200' requestBody: content: application/json: schema: type: object properties: api_key: type: string description: Your unique organization API key. login_id: type: string description: Your user login identifier. required: - api_key - login_id servers: - url: https://api.xeonda.com components: schemas: Auth_login_Response_200: type: object properties: auth_token: type: string title: Auth_login_Response_200 ``` ## SDK Code Examples ```python Auth_login_example import requests url = "https://api.xeonda.com/auth/token" payload = { "api_key": "5f3a67d8e2b14c9a8b1234567890abcdef1234567890abcdef1234567890abcd", "login_id": "partner@example.com" } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Auth_login_example const url = 'https://api.xeonda.com/auth/token'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"api_key":"5f3a67d8e2b14c9a8b1234567890abcdef1234567890abcdef1234567890abcd","login_id":"partner@example.com"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Auth_login_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.xeonda.com/auth/token" payload := strings.NewReader("{\n \"api_key\": \"5f3a67d8e2b14c9a8b1234567890abcdef1234567890abcdef1234567890abcd\",\n \"login_id\": \"partner@example.com\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Auth_login_example require 'uri' require 'net/http' url = URI("https://api.xeonda.com/auth/token") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"api_key\": \"5f3a67d8e2b14c9a8b1234567890abcdef1234567890abcdef1234567890abcd\",\n \"login_id\": \"partner@example.com\"\n}" response = http.request(request) puts response.read_body ``` ```java Auth_login_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.xeonda.com/auth/token") .header("Content-Type", "application/json") .body("{\n \"api_key\": \"5f3a67d8e2b14c9a8b1234567890abcdef1234567890abcdef1234567890abcd\",\n \"login_id\": \"partner@example.com\"\n}") .asString(); ``` ```php Auth_login_example request('POST', 'https://api.xeonda.com/auth/token', [ 'body' => '{ "api_key": "5f3a67d8e2b14c9a8b1234567890abcdef1234567890abcdef1234567890abcd", "login_id": "partner@example.com" }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Auth_login_example using RestSharp; var client = new RestClient("https://api.xeonda.com/auth/token"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"api_key\": \"5f3a67d8e2b14c9a8b1234567890abcdef1234567890abcdef1234567890abcd\",\n \"login_id\": \"partner@example.com\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Auth_login_example import Foundation let headers = ["Content-Type": "application/json"] let parameters = [ "api_key": "5f3a67d8e2b14c9a8b1234567890abcdef1234567890abcdef1234567890abcd", "login_id": "partner@example.com" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.xeonda.com/auth/token")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```