Skip to main content

Worldly Public API Authentication Guide

This guide explains how to authenticate requests to the Worldly Public API, including how to generate and use the required headers.

Overview

Every Worldly API request requires two authentication headers:
Note: The x-developer-request-token expires every 12 hours. You must regenerate it periodically to maintain access.

Prerequisites

Before beginning, ensure you have the following:
  • A valid Developer Account API Key
  • A valid Integration Account API Key
  • The Developer Public Key (public.pem) downloaded from the Worldly Platform
    • Profile > Account Settings > Integrations
  • OpenSSL installed
    • macOS default path: /opt/homebrew/bin/openssl
    • Windows: Win32 OpenSSL

macOS / Linux Instructions

1. Set Environment Variables

Check both values are set correctly:

Both numbers should be non-zero.

2. Create the Plaintext Token String

Combine your Integration Key and the current UTC timestamp with an ampersand (&) separator:
This file must contain a single line without a trailing newline.

Example content:


3. Encrypt Using Your Developer Public Key

Encrypt the string with your Developer Public Key, then Base64-encode it.

Save the output token to an environment variable:


4. Send an API Request


5. Troubleshooting


6. Example: Full Script (macOS/Linux)


7. Token Renewal

  • Tokens expire after 12 hours.
  • Add this script to a cron job or automated workflow that runs twice daily.

Windows / PowerShell Instructions

1. Set Environment Variables

Confirm they’re set:

2. Create the Plaintext String


3. Encrypt and Encode

Check token length:

4. Send API Request


5. Troubleshooting


6. Example: Full PowerShell Script


7. Token Renewal

  • Tokens expire every 12 hours.
  • Automate regeneration with a Windows Task Scheduler job that runs the script twice daily.

Quick Reference


Summary

  1. Combine your Integration Key and a current UTC timestamp.
  2. Encrypt the string with your Developer Public Key using OpenSSL.
  3. Base64-encode and remove newlines.
  4. Send the token as x-developer-request-token along with your x-api-key.
  5. Regenerate every 12 hours.