# Get User Details GET https://api-gateway-stg.transak.com/api/v2/user/ The **Get User Details** is an **authenticated API** call that allows you to fetch the user details of the authenticated user. Reference: https://docs.transak.com/api/whitelabel/user/get-user-details ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: whitelabel-api version: 1.0.0 paths: /api/v2/user/: get: operationId: get-user-details summary: Get User Details description: >- The **Get User Details** is an **authenticated API** call that allows you to fetch the user details of the authenticated user. tags: - subpackage_user parameters: - name: apiKey in: query description: Your API Key from Transak Dashboard required: true schema: type: string default: YOUR_API _KEY - name: authorization in: header description: >- Authorization token is the accessToken received from the API -` api/v2/auth/verify` required: true schema: type: string default: YOUR_USER_AUTH_TOKEN - name: x-user-identifier in: header description: >- Your authenticated user Email Id address. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) required: false schema: type: string default: USER_EMAIL_ID - name: x-access-token in: header description: > Your Partner Access Token. Please refer [here](/guides/how-to-create-partner-access-token) for a tutorial on generating your access token. Note: This is applicable only for [Auth Reliance Flows](/features/auth-reliance) required: false schema: type: string default: YOUR_ACCESS_TOKEN responses: '200': description: 200 - Success New User content: application/json: schema: $ref: '#/components/schemas/User_get-user-details_Response_200' '400': description: 400 - Session Expired content: application/json: schema: $ref: '#/components/schemas/Get-user-detailsRequestBadRequestError' '401': description: 401 - Unauthorized content: application/json: schema: $ref: '#/components/schemas/Get-user-detailsRequestUnauthorizedError' '500': description: 500 - Internal Server Error content: application/json: schema: $ref: >- #/components/schemas/Get-user-detailsRequestInternalServerError servers: - url: https://api-gateway-stg.transak.com components: schemas: ApiV2UserGetResponsesContentApplicationJsonSchemaDataKyc: type: object properties: status: type: string type: type: string required: - status - type title: ApiV2UserGetResponsesContentApplicationJsonSchemaDataKyc ApiV2UserGetResponsesContentApplicationJsonSchemaDataAddress: type: object properties: addressLine1: type: string addressLine2: type: string state: type: string city: type: string postCode: type: string country: type: string countryCode: type: string required: - addressLine1 - addressLine2 - state - city - postCode - country - countryCode title: ApiV2UserGetResponsesContentApplicationJsonSchemaDataAddress ApiV2UserGetResponsesContentApplicationJsonSchemaData: type: object properties: partnerUserId: type: string firstName: type: string lastName: type: string email: type: string mobileNumber: type: string status: type: string dob: type: string kyc: $ref: >- #/components/schemas/ApiV2UserGetResponsesContentApplicationJsonSchemaDataKyc address: $ref: >- #/components/schemas/ApiV2UserGetResponsesContentApplicationJsonSchemaDataAddress required: - partnerUserId - firstName - lastName - email - mobileNumber - status - dob - kyc - address title: ApiV2UserGetResponsesContentApplicationJsonSchemaData User_get-user-details_Response_200: type: object properties: data: $ref: >- #/components/schemas/ApiV2UserGetResponsesContentApplicationJsonSchemaData required: - data title: User_get-user-details_Response_200 ApiV2UserGetResponsesContentApplicationJsonSchemaError: type: object properties: statusCode: type: integer message: type: string required: - statusCode - message title: ApiV2UserGetResponsesContentApplicationJsonSchemaError Get-user-detailsRequestBadRequestError: type: object properties: error: $ref: >- #/components/schemas/ApiV2UserGetResponsesContentApplicationJsonSchemaError required: - error title: Get-user-detailsRequestBadRequestError Get-user-detailsRequestUnauthorizedError: type: object properties: error: $ref: >- #/components/schemas/ApiV2UserGetResponsesContentApplicationJsonSchemaError required: - error title: Get-user-detailsRequestUnauthorizedError Get-user-detailsRequestInternalServerError: type: object properties: error: $ref: >- #/components/schemas/ApiV2UserGetResponsesContentApplicationJsonSchemaError required: - error title: Get-user-detailsRequestInternalServerError ``` ## SDK Code Examples ```python Success New User import requests url = "https://api-gateway-stg.transak.com/api/v2/user/" querystring = {"apiKey":"YOUR_API _KEY"} headers = { "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN" } response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript Success New User const url = 'https://api-gateway-stg.transak.com/api/v2/user/?apiKey=YOUR_API+_KEY'; const options = { method: 'GET', headers: { authorization: 'YOUR_USER_AUTH_TOKEN', 'x-user-identifier': 'USER_EMAIL_ID', 'x-access-token': 'YOUR_ACCESS_TOKEN' } }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Success New User package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-gateway-stg.transak.com/api/v2/user/?apiKey=YOUR_API+_KEY" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("authorization", "YOUR_USER_AUTH_TOKEN") req.Header.Add("x-user-identifier", "USER_EMAIL_ID") req.Header.Add("x-access-token", "YOUR_ACCESS_TOKEN") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Success New User require 'uri' require 'net/http' url = URI("https://api-gateway-stg.transak.com/api/v2/user/?apiKey=YOUR_API+_KEY") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["authorization"] = 'YOUR_USER_AUTH_TOKEN' request["x-user-identifier"] = 'USER_EMAIL_ID' request["x-access-token"] = 'YOUR_ACCESS_TOKEN' response = http.request(request) puts response.read_body ``` ```java Success New User import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api-gateway-stg.transak.com/api/v2/user/?apiKey=YOUR_API+_KEY") .header("authorization", "YOUR_USER_AUTH_TOKEN") .header("x-user-identifier", "USER_EMAIL_ID") .header("x-access-token", "YOUR_ACCESS_TOKEN") .asString(); ``` ```php Success New User request('GET', 'https://api-gateway-stg.transak.com/api/v2/user/?apiKey=YOUR_API+_KEY', [ 'headers' => [ 'authorization' => 'YOUR_USER_AUTH_TOKEN', 'x-access-token' => 'YOUR_ACCESS_TOKEN', 'x-user-identifier' => 'USER_EMAIL_ID', ], ]); echo $response->getBody(); ``` ```csharp Success New User using RestSharp; var client = new RestClient("https://api-gateway-stg.transak.com/api/v2/user/?apiKey=YOUR_API+_KEY"); var request = new RestRequest(Method.GET); request.AddHeader("authorization", "YOUR_USER_AUTH_TOKEN"); request.AddHeader("x-user-identifier", "USER_EMAIL_ID"); request.AddHeader("x-access-token", "YOUR_ACCESS_TOKEN"); IRestResponse response = client.Execute(request); ``` ```swift Success New User import Foundation let headers = [ "authorization": "YOUR_USER_AUTH_TOKEN", "x-user-identifier": "USER_EMAIL_ID", "x-access-token": "YOUR_ACCESS_TOKEN" ] let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway-stg.transak.com/api/v2/user/?apiKey=YOUR_API+_KEY")! 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() ```