Get Customer
get
https://{BASE_URL}/customer/{customer_id}
View details of the customer that was created
CODE SAMPLES
HTTP
GET customer/{customer_id} HTTP/1.1
Host: https://{BASE_URL}
Nodejs Axios
var axios = require('axios');
var config = {
method: 'get',
url: 'https://{BASE_URL}/v1/customer/{customer_id}',
headers: { }
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
PHP - cURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://{BASE_URL}/v1/customer/cd989813-9852-40f6-bca7-ea0233d48cb9',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Java - Unirest
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://{BASE_URL}/v1/customer/cd989813-9852-40f6-bca7-ea0233d48cb9")
.asString();
Python - Requests
import requests
url = "https://{BASE_URL}/v1/customer/cd989813-9852-40f6-bca7-ea0233d48cb9"
payload={}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Go - Native
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://{BASE_URL}/v1/customer/cd989813-9852-40f6-bca7-ea0233d48cb9"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Last modified 10mo ago