Getting Started

Outlined below are 4 key considerations to keep in mind when planning for and making API calls to the Leap endpoints.

1. Leap user account

Your Leap user account credentials are required to log into the following:

  • Partner Portal (Production | Staging) to validate data within your account (e.g. connections, meters, dispatch events, performance, revenue)
    • NOTE: your same credentials will work in both Production and Staging
  • Partner Account page (Production | Staging) within Partner Portal to view/manage API keys, invite new admin users, manage permissions, etc.
  • Login API endpoint to get a bearer auth token for subsequent API calls
    • NOTE: this is not needed if you are using an API key instead
  • Knowledge Center to view Leap platform guides as well as market and program-specific operational guides

Reach out to your Leap account manager or [email protected] if you don’t yet have an account and need one created.

2. Staging vs. production base URL

Decide whether you want to make a call in the staging or production environments:

3. Bearer token for authentication

All requests to the Leap API endpoints must include a valid Bearer token in the HTTP Authorization header. There are 2 methods for obtaining this token:

POST /v2/meters/enrollments/search HTTP/2
Accept-Encoding: gzip
Host: example.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiOWIxODc2YzEtMTk5Yy00ZjRjLWJmYjEtNWZkMTEzM2M1MGJjIiwiYWNjb3VudF9pZCI6ImJjZjc1YWQ3LTE5OWMtMTk1NC1iZmIxLTVmZTExMzNhNTBiYyIsInBlcm1pc3Npb25zIjpbIlJlZ2lzdGVyTWV0ZXIiLCJHZXRNZXRlciIsIkRlbGV0ZU1ldGVyIiwiUGxhY2VCaWQiLCJHZXRCaWQiXSwiZXhwaXJhdGlvbl9kYXRlIjoiMjAxOC0wNy0wOVQxMzoxNjo0N1oifQ.6WQXgno7zU9lrn0IeZYMSoYGNTHUi26m6S5grSGHfEI

❗️

403 Errors - Production vs. Staging

API keys (and login-based auth tokens) are scoped to production or staging environments separately so make sure you are creating your key in the appropriate environment in which you want to use it. You will receive a 403 error if the key (or login-based auth token) is invalid.

4. Submit initial calls from your browser

Choose the endpoint you want to use on the API Reference tab by drilling down in the left panel to see the list of endpoints within each meter journey phase. After selecting an endpoint, the middle panel includes request parameters and response body descriptions. The right panel shows a response example but it also allows you to submit calls using the 'Try It' button.

Simply follow these steps to test from within your browser:

  1. Under the CREDENTIALS section on the right, add your auth token from #3 above (API Key | Login Authentication) into the Bearer field
  2. Under the URL section on the right, choose the the Production vs. Staging base URL
  3. If applicable or required, enter any QUERY, PATH, or BODY PARAMS in the middle panel
  4. Click the ‘Try It!’ button to see the output in the RESPONSE box at the bottom of the right panel

🚧

Auto-Populated Bearer Token

When logged into the Partner Portal and making calls from the browser in this developer portal, your Staging token is automatically populated. However, for Production calls, a valid production bearer token (API key or login token) must be used in the CREDENTIALS box instead.

Endpoint Example (middle and right panels):


What’s Next