Loading

API Endpoint Returns 302 Redirect Due to Incorrect Salesforce Domain

Data pubblicazione: Nov 12, 2025
Descrizione

When making API requests to Salesforce, the request may return a 302 (Found / Redirect) status code. This typically occurs when the API call is sent to the wrong Salesforce domain.

According to the Salesforce REST API documentation, the URI for a resource must follow the correct base URI format for the organization: https://MyDomainName.my.salesforce.com

Using an incorrect domain (for example, yourdomain.lightning.force.com) will cause Salesforce to respond with a 302 redirect to the correct instance.

Risoluzione

To find the correct API base domain for your Salesforce organization:

  1. Log in to Salesforce (either Production or Sandbox).

  2. In Salesforce, go to Setup.

  3. Navigate to Company Settings → My Domain.

  4. Under My Domain Details, note Current My Domain URL (for example, https://mycompany.my.salesforce.com).

  5. Use this My Domain URL as the base URI in your REST API calls.

Numero articolo Knowledge

005228480

 
Caricamento
Salesforce Help | Article