Get Auth Token
Exchanges your partner clientId + clientSecret for a short-lived Bearer token used on all subsequent calls.
/public/getAuthTokenHeaders
| Header | Value |
|---|---|
clientId | {your_client_id} |
clientSecret | {your_client_secret} |
Code Sample
const axios = require('axios');
const options = {
method: 'POST',
url: 'https://privatelabel-services.lookzup.com/v1/public/getAuthToken',
headers: {
'clientId': '{your_client_id}',
'clientSecret': '{your_client_secret}'
}
};
axios.request(options)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.error(error);
});
fetch('https://privatelabel-services.lookzup.com/v1/public/getAuthToken', {
method: 'POST',
headers: {
'clientId': '{your_client_id}',
'clientSecret': '{your_client_secret}'
}
})
.then((res) => res.json())
.then((data) => console.log(data))
.catch((err) => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://privatelabel-services.lookzup.com/v1/public/getAuthToken',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'clientId: {your_client_id}',
'clientSecret: {your_client_secret}'
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://privatelabel-services.lookzup.com/v1/public/getAuthToken"
headers = {
'clientId': '{your_client_id}',
'clientSecret': '{your_client_secret}'
}
response = requests.post(url, headers=headers)
print(response.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class LookzUpApiExample {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://privatelabel-services.lookzup.com/v1/public/getAuthToken"))
.headers("clientId", "{your_client_id}", "clientSecret", "{your_client_secret}")
.POST(HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
NSURL *url = [NSURL URLWithString:@"https://privatelabel-services.lookzup.com/v1/public/getAuthToken"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setValue:@"{your_client_id}" forHTTPHeaderField:@"clientId"];
[request setValue:@"{your_client_secret}" forHTTPHeaderField:@"clientSecret"];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"Error: %@", error);
return;
}
NSError *parseError;
id json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"Response: %@", json);
}];
[task resume];
import 'dart:convert';
import 'package:http/http.dart' as http;
Future<void> callLookzUpApi() async {
final url = Uri.parse('https://privatelabel-services.lookzup.com/v1/public/getAuthToken');
final headers = {
'clientId': '{your_client_id}',
'clientSecret': '{your_client_secret}'
};
final response = await http.post(url, headers: headers);
print(response.body);
}
