API Explorer
Test and explore Salesforce REST API endpoints with Crudspace.io
API Explorer
The API Explorer in Crudspace.io provides a comprehensive interface for testing and exploring Salesforce REST API endpoints. This feature helps developers understand API behavior, test requests, and troubleshoot integration issues.
Overview
The Salesforce REST API provides a powerful way to interact with Salesforce data programmatically. The API Explorer offers:
- A user-friendly interface for making REST API requests
- Pre-configured endpoint templates for common operations
- Request building with proper authentication
- Response visualization and formatting
- History tracking of previous requests
Accessing the API Explorer
To access the API Explorer:
- Log in to Crudspace.io
- From the left sidebar, click on "API Explorer"
Interface Components
Request Builder
The left panel provides tools to construct your API request:
- Method Selector: Choose the HTTP method (GET, POST, PUT, PATCH, DELETE)
- Endpoint Input: Enter the API endpoint URL
- Headers Editor: Configure request headers
- Body Editor: Build the request body for POST, PUT, and PATCH requests
- Authentication: Automatically handled based on your Salesforce connection
Response Viewer
The right panel displays the API response with:
- Status code and timing information
- Formatted response body (JSON or XML)
- Response headers
- Error details when applicable
Control Panel
The toolbar offers options to:
- Send the current request
- Save requests for later use
- Clear the current request/response
- Copy response data to clipboard
- Export response to a file
Working with API Requests
Building a Request
- Select the appropriate HTTP method (GET, POST, PUT, PATCH, DELETE)
- Enter the API endpoint URL (e.g.,
/services/data/v58.0/sobjects/Account) - Add any necessary headers
- For POST, PUT, or PATCH requests, provide a request body
- Click "Send" to execute the request
Viewing the Response
- After sending a request, the Response Viewer will display:
- HTTP status code
- Response time
- Formatted response body
- Response headers
- Use the formatting options to view the response in different formats
- Expand/collapse sections of the response for easier reading
Using Endpoint Templates
- Click the "Templates" dropdown
- Select a pre-configured endpoint template:
- Object Metadata
- Query Records
- Create Record
- Update Record
- Delete Record
- And more...
- The template will populate the request builder with appropriate values
- Customize the template as needed before sending
Managing Request History
- The History panel shows your recent API requests
- Click on any historical request to load it into the Request Builder
- Modify and resend previous requests as needed
Common API Operations
Retrieving Object Metadata
GET /services/data/v58.0/sobjects/Account/describe
Querying Records
GET /services/data/v58.0/query?q=SELECT+Id,Name+FROM+Account+LIMIT+10
Creating a Record
POST /services/data/v58.0/sobjects/Account
Content-Type: application/json
{
"Name": "New Account",
"Industry": "Technology"
}
Updating a Record
PATCH /services/data/v58.0/sobjects/Account/001XXXXXXXXXXXX
Content-Type: application/json
{
"Industry": "Healthcare"
}
Deleting a Record
DELETE /services/data/v58.0/sobjects/Account/001XXXXXXXXXXXX
Advanced Features
Bulk API Support
The API Explorer supports Salesforce Bulk API operations:
- Select the Bulk API template
- Configure your operation (insert, update, upsert, delete, query)
- Provide the necessary data
- Monitor the bulk job status
Composite Requests
Create composite requests to perform multiple operations in a single transaction:
- Select the Composite API template
- Add multiple subrequests
- Configure each subrequest with its own method, URL, and body
- Send the composite request
OAuth Token Management
The API Explorer automatically handles authentication:
- Tokens are refreshed when needed
- Authentication headers are automatically added to requests
- Token information can be viewed in the Authentication panel
Best Practices
- Start Simple: Begin with simple GET requests to understand API behavior
- Examine Responses: Carefully review response data and error messages
- Use Templates: Leverage pre-configured templates for common operations
- Monitor Limits: Be aware of API rate limits when making multiple requests
- Handle Errors: Pay attention to error responses for troubleshooting
Security Considerations
- Sensitive Data: Be cautious when working with sensitive data in the API Explorer
- Token Security: Your OAuth tokens are securely managed but use caution on shared devices
- Data Modification: Remember that POST, PUT, PATCH, and DELETE operations modify your Salesforce data