Salesforce

API endpoints for Salesforce metadata operations including analyzing file paths, generating package.xml, and updating package.xml files for Salesforce deployments.

Analyze Salesforce File Paths

post

Maps Salesforce component types for given file paths. This endpoint analyzes the provided file paths and identifies the corresponding Salesforce metadata component types.

Use Cases

  • Component Discovery: Identify Salesforce component types from file paths in a repository.

  • Metadata Analysis: Analyze file paths to determine metadata types for deployment.

  • Package Generation Preparation: Prepare file path information before generating package.xml.


Required Access

  • Authentication: Bearer token is required in the Authorization header.

  • Permissions: User must have Administrator or Power User role.


Important Notes!

  • File Paths: Provide relative file paths from the Salesforce project root.

  • Supported Types: Standard Salesforce metadata types are supported.

  • Rate Limits: Be aware of any rate limits that may apply to this endpoint.

Authorizations
AuthorizationstringRequired

API authentication using Bearer tokens. Include your API token in the Authorization header: Authorization: Bearer <your-api-token>

Tokens can be obtained from the Opsera platform's API token management interface.

Body
filePathsstring[]Required

Array of file paths to analyze for Salesforce component types

Example: ["force-app/main/default/classes/AccountController.cls","force-app/main/default/objects/Account/fields/CustomField__c.field-meta.xml"]
sourceDirectorystringOptional

Optional source directory path

Example: force-app/main/default
Responses
chevron-right
200

Successfully analyzed file paths

application/json
statusstringOptional

Status of the operation

Example: success
post
/api/v2/salesforce/analyze/files

Generate Salesforce Package XML

post

Generates a Salesforce package.xml file from the provided component types and metadata information. This endpoint creates a properly formatted package.xml that can be used for Salesforce deployments.

Use Cases

  • Deployment Preparation: Generate package.xml for deploying changes to Salesforce org.

  • Selective Deployment: Create package.xml with specific components for targeted deployments.

  • CI/CD Integration: Automate package.xml generation in deployment pipelines.


Required Access

  • Authentication: Bearer token is required in the Authorization header.

  • Permissions: User must have Administrator or Power User role.


Important Notes!

  • API Version: Specify the Salesforce API version for the package.xml.

  • Component Types: Ensure component type names match Salesforce metadata API naming conventions.

  • Wildcard Support: Use '*' as member name to include all components of a type.

Authorizations
AuthorizationstringRequired

API authentication using Bearer tokens. Include your API token in the Authorization header: Authorization: Bearer <your-api-token>

Tokens can be obtained from the Opsera platform's API token management interface.

Body
apiVersionstringOptional

Salesforce API version for the package

Default: 59.0Example: 59.0
Responses
chevron-right
200

Successfully generated package.xml

application/json
statusstringOptional

Status of the operation

Example: success
post
/api/v2/salesforce/generate/package-xml

Update Salesforce Package XML

post

Updates an existing Salesforce package.xml with new components. This endpoint allows you to merge new component types and members into an existing package.xml structure.

Use Cases

  • Incremental Updates: Add new components to an existing package.xml without regenerating.

  • Merge Operations: Combine multiple component sets into a single package.xml.

  • CI/CD Integration: Dynamically update package.xml during build/deployment processes.


Required Access

  • Authentication: Bearer token is required in the Authorization header.

  • Permissions: User must have Administrator or Power User role.


Important Notes!

  • Existing Package: Provide the current package.xml content to be updated.

  • Merge Behavior: New components are merged with existing ones; duplicates are handled.

  • API Version: The API version can be updated as part of the operation.

Authorizations
AuthorizationstringRequired

API authentication using Bearer tokens. Include your API token in the Authorization header: Authorization: Bearer <your-api-token>

Tokens can be obtained from the Opsera platform's API token management interface.

Body
packageXmlstringRequired

Existing package.xml content to update

Example: <?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata">...</Package>
apiVersionstringOptional

Optional new Salesforce API version

Example: 60.0
Responses
chevron-right
200

Successfully updated package.xml

application/json
statusstringOptional

Status of the operation

Example: success
post
/api/v2/salesforce/update-package-xml

Last updated