PostGrid provides address autocomplete and address verification for the United States, Canada and international addresses. This article explains which PostGrid keys you need and how to enter them in Address Validation for Dataverse.
Before you start
- A PostGrid account with address verification enabled.
- An Address Validation license that includes the PostGrid add-on. Without it, PostGrid is not offered as a Validation Service Type.
You need two keys
PostGrid issues two kinds of API keys, and Address Validation uses both:
| Key | Starts with | Used by | Why |
|---|---|---|---|
| Public key | live_pk_ (or test_pk_) | The PostGrid autocomplete control on your forms | The control runs in the user's browser, so it must use a public key. Public keys only work from web addresses (origins) you register in PostGrid. |
| Secret key | live_sk_ (or test_sk_) | Workflows and Power Automate actions | Verification runs on the server, where a public key is rejected. A secret key must never be used in the browser. |
Each API Configuration record holds one key, so you create two API Configuration records if you use both autocomplete and verification.
Test keys (test_) do not use any lookups but return sample data. Use them to build and test your configuration, and switch to live keys to check real results.
Step 1: Get your keys from PostGrid
- Sign in to your PostGrid dashboard and open the API keys page for address verification.
- Copy your public key and your secret key.
- For the public key, add your Dataverse environment URL to its allowed origins, for example
https://contoso.crm.dynamics.com. PostGrid also accepts a wildcard for one level, such ashttps://*.crm.dynamics.com, which covers every environment in that region.
Step 2: Create the API Configuration records
- In the Address Validation for Power Apps app, go to Settings > API Configuration.
- Create a record for the autocomplete control:
- API Configuration Name: a unique name, for example
PostGrid Autocomplete. - Validation Service Type: PostGrid API.
- Service License Key: your public key.
- API Configuration Name: a unique name, for example
- Create a second record for verification:
- API Configuration Name: for example
PostGrid Verify. - Validation Service Type: PostGrid API.
- Service License Key: your secret key.
- API Configuration Name: for example
- Save each record. To log each PostGrid call, set Save Transaction Logs to Yes; the details appear in Logs, under the Resources area.
Costs and limits
- PostGrid bills per lookup. In the autocomplete control, suggestions shown while typing are free; one lookup is used when the user selects an address.
- Each verification uses one lookup, plus one more when geocoding (latitude and longitude) is requested. Geocoding is off by default and must also be enabled on your PostGrid account by PostGrid support.
- PostGrid limits address requests to 5 per second for your whole organization. Large numbers of concurrent workflows or flows can reach this limit.
Troubleshooting
| Symptom | What to check |
|---|---|
| The autocomplete control shows an origin or access error | The control's API Configuration must hold the public key, and your environment URL must be in the key's allowed origins. |
| A workflow or flow reports that PostGrid rejected the key because of its allowed-origins restriction | The verification API Configuration holds a public key. Use the secret key. |
| HTTP 403 with no origin message | Your PostGrid lookups are used up. Check your remaining balance in the PostGrid dashboard. |
| PostGrid API is not offered as a Validation Service Type | Your Address Validation license does not include the PostGrid add-on. Update your license or contact support@sharpxrm.com. |