# Get device history GET https://api-sandbox.payabli.com/api/Cloud/history/{entry}/{deviceId} Retrieve the registration history for a device. Reference: https://docs.payabli.com/developers/api-reference/cloud/get-registration-history-for-device ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get registration history for device version: endpoint_cloud.HistoryDevice paths: /Cloud/history/{entry}/{deviceId}: get: operationId: history-device summary: Get registration history for device description: 'Retrieve the registration history for a device. ' tags: - - subpackage_cloud parameters: - name: entry in: path description: >- The paypoint's entrypoint identifier. [Learn more](/developers/api-reference/api-overview#entrypoint-vs-entry) required: true schema: type: string - name: deviceId in: path description: 'ID of the cloud device. ' required: true schema: type: string - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_:CloudQueryApiResponse' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} components: schemas: type_:IsSuccess: type: boolean type_:PoiDevice: type: object properties: connected: type: boolean description: The device connection status. dateDeRegistered: type: string format: date-time description: The date the device was unregistered. dateRegistered: type: string format: date-time description: The date the device was registered. deviceId: type: string description: The device identifier. deviceLicense: type: string description: Device license. This is typically the same as `deviceId`. deviceNickName: type: string description: Device description provided during registration. lastConnectedDate: type: string format: date-time description: Last connected date. lastDisconnectedDate: type: string format: date-time description: Last disconnected date. lastTransactionDate: type: string format: date-time description: Last transaction date. make: type: string description: The device manufacturer. model: type: string description: The device model. registered: type: boolean description: The device registration status. serialNumber: type: string description: The device serial number. type_:ResponseText: type: string type_:CloudQueryApiResponse: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseList: type: array items: $ref: '#/components/schemas/type_:PoiDevice' description: List of devices and history of registration. responseText: $ref: '#/components/schemas/type_:ResponseText' required: - responseText ``` ## SDK Code Examples ```python Example response for GET requests for devices. from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.cloud.history_device( device_id="WXGDWB", entry="8cfec329267", ) ``` ```typescript Example response for GET requests for devices. import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.cloud.historyDevice("8cfec329267", "WXGDWB"); ``` ```go Example response for GET requests for devices. import ( context "context" option "github.com/payabli/sdk-go/option" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Cloud.HistoryDevice( context.TODO(), "WXGDWB", "8cfec329267", ) ``` ```csharp Example response for GET requests for devices. using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Cloud.HistoryDeviceAsync("WXGDWB", "8cfec329267"); ``` ```ruby Example response for GET requests for devices. require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Cloud/history/8cfec329267/WXGDWB") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java Example response for GET requests for devices. HttpResponse response = Unirest.get("https://api-sandbox.payabli.com/api/Cloud/history/8cfec329267/WXGDWB") .header("requestToken", "") .asString(); ``` ```php Example response for GET requests for devices. request('GET', 'https://api-sandbox.payabli.com/api/Cloud/history/8cfec329267/WXGDWB', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift Example response for GET requests for devices. import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Cloud/history/8cfec329267/WXGDWB")! 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() ```