In this article, we’ve compiled a set of frequently asked questions to help customers navigate our API.
For more in-depth information, you can explore our Swagger documentation.
All calls require an Authorization header with bearer token.
1. How can I get all my connections?
GET INSTANCE_URL/services/apexrest/PDRI/v1/connections
2. How can I get my latest VC connection?
GET INSTANCE_URL/services/apexrest/PDRI/v1/connections?target=vcs
3. How can I update a connection?
PATCH INSTANCE_URL/services/apexrest/PDRI/v1/connections
{
accessToken: "string",
active: true,
connectionType: "string",
instanceUrl: "string,
name: "string",
orgId: "string",
orgType: "string",
refreshToken: "string",
target: "string"
}
4. How can I get or verify an existing connection knowing the connection ID?
GET INSTANCE_URL/services/apexrest/PDRI/v1/connections/connectionId
5. How can I get a job knowing the job ID?
GET INSTANCE_URL/services/apexrest/PDRI/v1/jobs/jobId
6. How can I get all my managed instances?
GET INSTANCE_URL/services/apexrest/PDRI/v1/instances
7. How can I manage an instance (without version control)?
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances
{
options: {
checkin: false,
checkout: false,
environmentExists: false
}
platformInstance: {
platformInstanceId: "string",
connectionId: "string",
instanceName: "string",
}
}
8. How can I manage an instance (with version control)?
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances
{
options: {
checkin: true,
checkout: true,
environmentExists: false
commitMessage: "string"
},
platformInstance: {
branchName: "string",
platformInstanceId: "string",
connectionId: "string",
instanceName: "string",
sourceBranchName: "string"
}
}
9. How can I add version control to an existing managed instance?
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances
{
options: {
checkin: true,
checkout: true,
environmentExists: true,
},
platformInstance: {
branchName: "string",
platformInstanceId: "string",
sourceBranchName: "string"
}
}
If you provide a “branchName” a new branch is going to be created based on the “sourceBranchName”. If you don’t the “sourceBranchName” will be used.
10. How can I update the name of a managed instance?
PUT INSTANCE_URL/services/apexrest/PDRI/v1/instances/instanceId
{
"platformInstance": {
"instanceName": "string",
"instanceUrl": "string",
"platformInstanceId": "00D6t000001UEA1EAO",
"label" : "string",
"licenceType" : "string"
}
}
11. How can I remove version control from a managed instance?
PUT INSTANCE_URL/services/apexrest/PDRI/v1/instances/instanceId
{
"platformInstance": {
"branchName": null,
"platformInstanceId": "string",
"sourceBranchName": null,
}
}
12. How can I unmanaged a managed environment?
DELETE INSTANCE_URL/services/apexrest/PDRI/v1/instances/instanceId
13. How can I perform a checkin (Org to Branch) with Data + Metadata?
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances/instanceId/checkin
{
"skipInserts": false,
"skipUpdates": true,
"instanceId": "string",
"options": {
"commitMessage": "string"
},
"datasetId": "string",
"queryFilter": {
"filter": "string",
"limit": 21,
"orderBy": {
"field": "string",
"order": "DESC"
}
},
"metadata": {
"compareJobId": "string",
"components": [
{
"componentId": "string",
"removeComponent": true
}
],
"destructiveChangesOrder": "pre",
"metadataFilterId": "string",
"metadataRollbackOnFailure": true,
"validation": false
},
"branchName": "string"
}
14. How can I perform a checkout (Branch to Org) with “with Data + Metadata?
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances/instanceId/checkout
{
"skipInserts": false,
"skipUpdates": false,
"branchName": "string",
"deploymentName": "string",
"deploymentNotes": "",
"datasetId": "string",
"forceDataDeployment": false,
"eventControlOptions": [
{
"deactivateAll": false
}
],
"metadata": {
"compareJobId": "string",
"components": [
{
"componentId": "string",
"removeComponent": true
}
],
"destructiveChangesOrder": "pre",
"metadataFilterId": "string",
"metadataRollbackOnFailure": true,
"validation": false
}
}
15. How can I perform a deployment (Org to Org) with “with Data + Metadata?
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances/instanceId/deploy
{
"skipInserts": false,
"skipUpdates": true,
"deploymentName": "string",
"deploymentNotes": "",
"source": {
"managedInstanceId": "string"
},
"forceDataDeployment": false,
"data": [
{
"dataSetId": "string",
"eventControlOptions": {
"deactivateAll": false
},
"simulation": false,
"queryFilter": {
"filter": "string",
"limit": 21,
"orderBy": {
"field": "string",
"order": "DESC"
}
}
}
],
"metadata": {
"compareJobId": "string",
"components": [
{
"componentId": "string",
"removeComponent": false
}
],
"destructiveChangesOrder": "pre",
"metadataFilterId": "string",
"metadataRollbackOnFailure": true,
"validation": false
}
}
16. How can I create a metadata validation?
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances/instanceId/deploy
{
"deploymentName": "string",
"deploymentNotes": "",
"source": {
"managedInstanceId": "string"
},
"metadata": {
"compareJobId": "string",
"components": [
{
"componentId": "string",
"removeComponent": false
}
],
"destructiveChangesOrder": "pre",
"metadataFilterId": "string",
"metadataRollbackOnFailure": true,
"validation": true
}
}
17. How can I create a data validation?
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances/instanceId/deploy
{
"skipInserts": false,
"skipUpdates": true,
"deploymentName": "string",
"deploymentNotes": "string",
"source": {
"managedInstanceId": "string"
},
"forceDataDeployment": false,
"data": [
{
"dataSetId": "string",
"eventControlOptions": {
"deactivateAll": false
},
"simulation": true,
"queryFilter": {
"filter": "string",
"limit": integer,
"orderBy": {
"field": "string",
"order": "DESC"
}
}
}
]
}
How can I include a work item in my deployment with Data? (Assuming an integration is connected)
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances/instanceId/deploy
{
"deploymentName": "string",
"deploymentNotes": "",
"source": {
"managedInstanceId": "string"
},
"workItemTrackings": [
{
"description": "string",
"issueType": "string",
"link": "string",
"name": "string",
"workItemId": "string",
"workItemKey": "string",
"workItemType": "string"
}
],
"forceDataDeployment": false,
"data": [
{
"dataSetId": "string",
"eventControlOptions": {
"deactivateAll": false
},
"simulation": true
}
]
}
18. How can I execute a test case?
POST INSTANCE_URL/services/apexrest/PDRI/v1/test/test-cases/execute
{
"testCaseIds": [
"string",
],
"testRunId": "string",
"managedInstanceId": "string"
}
19. How can I create a scratch org from a change type?
First, you need to fetch the change type you want to use to create the scratch org from.
You can fetch your change types using (you can provide page, limit and search using name):
GET INSTANCE_URL/services/apexrest/PDRI/v1/change-types?limit=20&page=1
Or if you know the Salesforce ID of the change type you want to use you can get it using:
GET INSTANCE_URL/services/apexrest/PDRI/v1/change-types/changetypeidd
{
"changeTypes": [
{
"id": "string",
"name": "string",
"generatedEnvironmentType": "Scratch Org",
"metadataRollbackOnFailure": true,
"skipDataOnMetadataFailure": true,
"durationDays": 7,
"managedEnvironment": {
"id": "string",
"instanceId": "string",
"instanceName": "Istring",
"instanceType": "Scratch Org",
"instanceUrl": "string",
"licenseType": "Scratch Org",
"controlInstance": true
},
"dataset": {
"id": "string",
"name": "stringt"
},
"deploymentPlan": {
"id": "string",
"name": "string"
},
"metadataFilter": {
"id": "string",
"name": "string"
},
"apexClass": "string",
"salesforcePackageIds": [
"string",
]
}
]
}
With the information from the change type, you can create a scratch org by calling:
POST INSTANCE_URL/services/apexrest/PDRI/v1/instances
If you have any further questions regarding Prodly’s API, please feel free contact support.