Search For a Customer
curl --request GET \
--url https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Customer gotten successfully",
"data": [
{
"_id": "6246412c902306075e09c71a",
"organisation": "62424e97d1e7590032dc7ed0",
"name": "William Client",
"email": "willy@yopmail.com",
"createdAt": "2022-04-01T00:02:52.078Z",
"updatedAt": "2022-04-01T00:02:52.078Z",
"id": "6246412c902306075e09c71a"
},
{
"_id": "6246440b4497dd0880a67262",
"organisation": "62424e97d1e7590032dc7ed0",
"name": "Magixxx Client",
"email": "magixx@yopmail.com",
"createdAt": "2022-04-01T00:15:07.566Z",
"updatedAt": "2022-04-01T00:15:07.566Z",
"id": "6246440b4497dd0880a67262"
}
]
}
Customers
Search For a Customer
Search for a customer by name or email
GET
api
/
customers
/
search
Search For a Customer
curl --request GET \
--url https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://ge-exchange-staging-1.herokuapp.com/v1/api/customers/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Customer gotten successfully",
"data": [
{
"_id": "6246412c902306075e09c71a",
"organisation": "62424e97d1e7590032dc7ed0",
"name": "William Client",
"email": "willy@yopmail.com",
"createdAt": "2022-04-01T00:02:52.078Z",
"updatedAt": "2022-04-01T00:02:52.078Z",
"id": "6246412c902306075e09c71a"
},
{
"_id": "6246440b4497dd0880a67262",
"organisation": "62424e97d1e7590032dc7ed0",
"name": "Magixxx Client",
"email": "magixx@yopmail.com",
"createdAt": "2022-04-01T00:15:07.566Z",
"updatedAt": "2022-04-01T00:15:07.566Z",
"id": "6246440b4497dd0880a67262"
}
]
}
The name of the customer to search for
The email of the customer to search for
{
"status": "success",
"message": "Customer gotten successfully",
"data": [
{
"_id": "6246412c902306075e09c71a",
"organisation": "62424e97d1e7590032dc7ed0",
"name": "William Client",
"email": "willy@yopmail.com",
"createdAt": "2022-04-01T00:02:52.078Z",
"updatedAt": "2022-04-01T00:02:52.078Z",
"id": "6246412c902306075e09c71a"
},
{
"_id": "6246440b4497dd0880a67262",
"organisation": "62424e97d1e7590032dc7ed0",
"name": "Magixxx Client",
"email": "magixx@yopmail.com",
"createdAt": "2022-04-01T00:15:07.566Z",
"updatedAt": "2022-04-01T00:15:07.566Z",
"id": "6246440b4497dd0880a67262"
}
]
}
Was this page helpful?
⌘I
