Loading

Salesforce Maps API Returning 4xx Status Codes (429 and 400 Errors)

Veröffentlichungsdatum: Sep 10, 2026
Beschreibung

While calling any Salesforce Maps API (like Geocoding, GetHostedData, etc.), you may sometimes receive 4xx status codes. These codes indicate that requests need to be revised, and any problems need to be corrected, before trying again.

Lösung

This article answers a common question about the Salesforce Maps API: what do 429 and 400 status codes mean, and how do you resolve them? The API returns these codes to protect itself from abuse, either by informing you that you are sending too many requests at once (429), or that you are sending bad requests that cannot be processed (400).

Resolving a 429 Status Code (Too Many Requests)

A 429 error code, as stated in the message body, means the requests were throttled because you exceeded the number of requests per minute the API allows. You can resolve this by spacing out your requests over a longer period of time.

Resolving a 400 Status Code (Bad Request)

A 400 error code signifies a bad request or an invalid request. The response body includes a message to help you correct the request. One common cause is sending over 50 addresses in a single Geocoding API call.

If the geocoder's match score falls at 50 or below, your code may be set to automatically retry the call. However, making repeated calls with the same input data won't produce a different match value, and repeated retries can in turn trigger a 429 error from too many requests. To avoid this cycle, confirm that the correct address information is being provided before making the call again.

You can automate this correction process based on the API's responses. For example, if a record returns `{ success: false, message: "Invalid address" }`, you could have your Apex code flag that record for manual review to ensure the address is corrected before retrying.

Additional Considerations

  • Bad requests (400 errors) still count against your total allowed request limit, so repeated bad requests can contribute to hitting a 429 error as well.

Nummer des Knowledge-Artikels

000989526

 
Laden
Salesforce Help | Article