Skip to content

Fetch customer devices

Get
bash
https://api.bunce.so/v1/customers/{customer_id}/devices

Returns devices using the customer id.

Request

Path Parameter string<uuid> required

id string<uuid> required
Identifier of the customer entity to work with.

bash
curl --request GET \
  --url https://api.bunce.so/v1/customers/0000 \
  --header 'X-Authorization: sk_live_************************'
go
import (
	"fmt"
	"net/http"
	"io/ioutil"
)

url := "https://api.bunce.so/v1/customers/0000/devices"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Authorization", "sk_live_************************")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))
js
import  from 'node-fetch'

let  =
  'https://api.bunce.so/v1/customers/0000/devices'

let  = {
  : 'GET',
  : {
    'X-Authorization': 'sk_live_************************',
  },
}

(, )
  .then(() => .json())
  .then(() => .())
  .catch(() => .('error:' + ))
php
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.bunce.so/v1/customers/0000/devices');
$request->setRequestMethod('GET');
$request->setHeaders([
  'X-Authorization' => 'sk_live_************************'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
java
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.bunce.so/v1/customers/0000/devices"))
    .header("X-Authorization", "sk_live_************************")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();

HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

Response

json
{
  "data": [
    {
      "device_id": "9c090883-8a05-40c7-9e9a-e3972f6a32d8",
      "device_type": "android",
      "token": "iubiwbcibweibiwcibiwecibibiwew",
      "created_at": "2024-05-13T18:48:34.000000Z"
    }
  ],
  "message": "Customer device tokens fetched successfully",
  "success": true
}