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:

  1. Log in to Crudspace.io
  2. 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

  1. Select the appropriate HTTP method (GET, POST, PUT, PATCH, DELETE)
  2. Enter the API endpoint URL (e.g., /services/data/v58.0/sobjects/Account)
  3. Add any necessary headers
  4. For POST, PUT, or PATCH requests, provide a request body
  5. Click "Send" to execute the request

Viewing the Response

  1. After sending a request, the Response Viewer will display:
    • HTTP status code
    • Response time
    • Formatted response body
    • Response headers
  2. Use the formatting options to view the response in different formats
  3. Expand/collapse sections of the response for easier reading

Using Endpoint Templates

  1. Click the "Templates" dropdown
  2. Select a pre-configured endpoint template:
    • Object Metadata
    • Query Records
    • Create Record
    • Update Record
    • Delete Record
    • And more...
  3. The template will populate the request builder with appropriate values
  4. Customize the template as needed before sending

Managing Request History

  1. The History panel shows your recent API requests
  2. Click on any historical request to load it into the Request Builder
  3. 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:

  1. Select the Bulk API template
  2. Configure your operation (insert, update, upsert, delete, query)
  3. Provide the necessary data
  4. Monitor the bulk job status

Composite Requests

Create composite requests to perform multiple operations in a single transaction:

  1. Select the Composite API template
  2. Add multiple subrequests
  3. Configure each subrequest with its own method, URL, and body
  4. Send the composite request

OAuth Token Management

The API Explorer automatically handles authentication:

  1. Tokens are refreshed when needed
  2. Authentication headers are automatically added to requests
  3. 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