API signature generation

Learn how to generate a signature for further work with the PassMe service.

  1. Prepare Parameters: For each request, prepare the parameters that will be transmitted. Include all necessary parameters in the request.

  2. Create a Query String: Create a query string by arranging all the parameters in the format key=value, separated by the & symbol.

  3. Sign the Query String: Use your private API key to sign the query string. Depending on the programming language used, you can use the following functions:

    • In PHP:

      $queryString = urldecode(http_build_query($params));
      $signature = hash_hmac('sha256', $queryString, $secretKey);
    • In JavaScript (using the CryptoJS library):

      let queryString = Object.keys(paramsObject).map((key) => {
              return `${key}=${paramsObject[key]}`;
      let signature = CryptoJS.HmacSHA256(queryString, secretKey).toString();

Last updated