Verify the validity of an Instant PlayPass claiming code.
Endpoint:/instantPlayPass/verify/claimingCode/{claimingCode}Method: GET
{
claimingCode: string; // The claiming code to verify
}
{
valid: boolean; // Whether the claiming code is valid
status: string; // Status of the claiming code
}
{
error: string;
}
Example Usage
const timestamp = Date.now().toString();
const claimingCode = 'ABC123XYZ'; // The claiming code to verify
// Since this is a GET request with no body, pass null as the body for HMAC
const hmac = generateHmacSignature(timestamp, null, secretKey);
const response = await axios.get(apiEndpoint + `/instantPlayPass/verify/claimingCode/${claimingCode}`, {
headers: {
apikey: apiKey,
signature: hmac,
timestamp: timestamp
}
});
// Check the validity and status of the claiming code
const { valid, status } = response.data;
if (valid) {
console.log('Claiming code is valid');
console.log('Status:', status);
// Proceed with the claiming process
} else {
console.log('Claiming code is invalid or expired');
// Handle invalid code (e.g., ask user to try again)
}