To use DPI Locker APIs, you need to provide a combination of the Lender's and Distributor's secrets, which should be base64 encoded. It should be provided in the Authorization
Header.
Format of Header: (Lender Secret):(Distributor Secret)
lender_secret = "sf9g0sg2oiirj9ugs9uf2urf2jfg"
distributor_secret = "90323hoijfsv0929riovsvqasg"
token = "#{lender_secret}" + ":" + "#{distributor_secret}"
encrypted_token = Base64.urlsafe_encode64(token)
import java.util.Base64;
public class Main {
public static void main(String[] args) {
String lenderSecret = "sf9g0sg2oiirj9ugs9uf2urf2jfg";
String distributorSecret = "90323hoijfsv0929riovsvqasg";
String token = lenderSecret + ":" + distributorSecret;
String encryptedToken = Base64.getUrlEncoder().encodeToString(token.getBytes());
System.out.println(encryptedToken);
}
}
const lenderSecret = "sf9g0sg2oiirj9ugs9uf2urf2jfg";
const distributorSecret = "90323hoijfsv0929riovsvqasg";
const token = `${lenderSecret}:${distributorSecret}`;
const encryptedToken = Buffer.from(token).toString('base64');
console.log(encryptedToken);
package main
import (
"encoding/base64"
"fmt"
)
func main() {
lenderSecret := "sf9g0sg2oiirj9ugs9uf2urf2jfg"
distributorSecret := "90323hoijfsv0929riovsvqasg"
token := fmt.Sprintf("%s:%s", lenderSecret, distributorSecret)
encryptedToken := base64.URLEncoding.EncodeToString([]byte(token))
fmt.Println(encryptedToken)
}
import base64
lender_secret = "sf9g0sg2oiirj9ugs9uf2urf2jfg"
distributor_secret = "90323hoijfsv0929riovsvqasg"
token = f"{lender_secret}:{distributor_secret}"
encrypted_token = base64.urlsafe_b64encode(token.encode()).decode()
print(encrypted_token)
encrypted_token : c2Y5ZzBzZzJvaWlyajl1Z3M5dWYydXJmMmpmZzo5MDMyM2hvaWpmc3YwOTI5cmlvdnN2cWFzZw==
Reach out to us to get access to our APIs.