2022
The REST API provide provides programmatic access to Read Reading and Write replication data. The REST API identifies the replication application and its users using OAUTH ; responses are available in json. We have used SWAGGER editor for the end users to make the API calls so that they can try out APIs exposed by our platform.
...
There are is two API Methods list which are is exposed for this release, we will be adding more methods in the upcoming releases. The order of the execution of API calls are as follows
The Replicate method is the actual API call used to invoke the replication process so that the Salesforce objects gets replicated to the Database. From this call, the process id is generated which is used in the checkStatus method to check the status of the replication process.
The below tables explains the various model schema and attributes which form the model class
Parameter | Description | DataType |
---|---|---|
Salesforce (optional) | The salesforce credentials which are required to connect to the salesforce Salesforce instance | Salesforce |
Database (optional) | The database credentials which are required to connect to supported databases | Database |
Objects (optional) | The salesfoce salesforce object which a client to replicate | Array Table |
Logs (optional) | The parameters related to Log settings and specific to DBSync | Log properties |
Run (optional) | The parameters related to run settings and specific to DBSync | Run properties |
Parameter | Description | DataType |
---|---|---|
SoapEndpoint (optional) | The url URL to access the salesforce Salesforce application | string |
bulkApiEnable (optional) | The possible values are True and false which enables and disables the bulkapi calls | boolean |
callbackurl (optional) | The dbsync DBSync call back urlURL | string |
consumerkey (optional) | Its a consumersecretkey generated from salesforce oauth | string |
ConsumerSecret (optional) | It's a consumerSecret generated from the salesforce oauth | string |
password (optional) | The password of the salesforce Salesforce instance | string |
username (optional) | The username of the salesforce Salesforce instance from which the user wishes to retrieve information for replication | string |
Parameter | Description | DataType |
---|---|---|
filereplication (optional) | The possible values are true and false to enable and disable the file replication | boolean |
s3 (optional) | The possible values are true and false, true if hosted on aws | boolean |
awsaccesskey (optional) | awsaccess key if db is hosted on aws, can be retrieved from the aws instance | string |
awsBucketName (optional) | awsBucketName if db is hosted on aws, can be retrieved from the aws instance | string |
awsRegion (optional) | awsRegion if db is hosted on aws, can be retrieved from the aws instance | string |
consumerSecret (optional) | ConsumerSecret if db is hosted on aws, can be retrieved from the aws instance | string |
database (optional) | Name of the database Eg: Sqlserver/Oracle/Mysql | string |
host (optional) | The location of the database for instance localhost | string |
password (optional) | the password of the database if any | string |
port (optional) | port number the database instance which uses | string |
schema (optional) | The name of the database | string |
type (optional) | Specify the database that is being used Eg: Oracle | string |
url URL (optional) | The url URL of the database which is generated by the replication in the connection string | string |
username (optional) | The username of the database | string |
Parameter | Description | DataType |
---|---|---|
excludes (optional) | If the user wishes to remove any of the fields from the selected object in salesforce then he can use this parameter | Array[string] |
filter (optional) | Filter The filter parameter is used to specify the condition to read data from salesforceSalesforce | string |
name (optional) | Name of the object that need needs to be retrieved from the salesforce | string |
Parameter | Description | DataType |
---|---|---|
emailerror (optional) | The possible values are true and false to enable the them and disable the email notification from DBSync replication tool | boolean |
database (optional) | The possible values are true and false to enable the them and disable the email notification of database from DBSync replication tool | boolean |
dir (optional) | The directory name if the database if flat file database | string |
emailreceipents (optional) | The email id of the receipient recipient to who the system is intended to send out the logs / notifications | Array[string] |
emailsender (optional) | The email id of the sender can be also be passed to identify the from address | string |
callbackURL (optional) | The dbsync url DBSync URL which sends the email notifcationsnotifications | string |
Parameter | Description | DataType |
---|---|---|
command (optional) | The commands which are internal to DBSync replication like Cleancopy, DBtoSF, SFtoDB,db_setup | string |
Profile (optional) | The profile name which user used in DBSync replication tool | string |
...
Parameter | Description | Data type |
Status | The possible values are True and False which sends out the response value | String |
SubmitTime | The API submitted time | Date |
CompletionTime | The API Completion Time | Date |
ProcessID | The process id which is sent by the API to identify the process | String |
callbackURL | The url URL is passed from the API | string |
Code Block |
---|
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"salesforce":{"soapEndpoint":"https://login.salesforce.com/services/Soap/u/32.0","bulkApiEnable":false,"callbackUrl":"https://localhost:8443/DBSync/oauth/_callback","consumerKey":"","consumerSecret":"3Q/190VEz3BnIu6bMGO2sg\\\\=\\\\=","password":"avankia!23","username":"ravindra.g@avankia.com"},"database":{"fileReplication":false,"fileVersion":false,"s3":false,"awsAccessKey":"","awsBucketName":"","awsRegion":"","consumerSecret":"","database":"ORCL","filepath":"","host":"10.0.0.9","password":"Avankia1","port":"1521","schema":"dbsync","type":"Oracle","url":"jdbc:oracle:thin:@10.0.0.9:1521:ORCL","username":"HR"},"objects":[{"excludes":[],"filter":"","name":"Account"}],"log":{"emailError":false,"database":true,"dir":"","emailRecipients":["ravindra.g@avankia.com"],"emailSender":"ravindra.g@avankia.com","callbackURL":"http://posttestserver.com/post.php"},"run":{"command":"cleancopy","profile":""}}' 'http://localhost:8080/webapi/appcode/repl-v4/ReplicationAPIDriver/replicate' |
Code Block |
---|
http://localhost:8080/webapi/appcode/repl-v4/ReplicationAPIDriver/replicate |
Code Block |
---|
{ "value": [ { "status": "submitted", "submitTime": "2016-04-21T19:31:37Z", "processId": "ravindra.g@avankia.com-1461267097548/cleancopy", "callbackURL": "http://posttestserver.com/post.php" } ] } |
Code Block |
---|
h6. 200 |
Code Block |
---|
{ "date": "Thu, 21 Apr 2016 19:31:37 GMT", "server": "Apache-Coyote/1.1", "content-length": "182", "content-type": "application/json" } |
The Check status method is used to return the status of the replication process and to invoke this method user must have the process id attribute . The process id can be generated from the first method "Replicate", the check status method has two parts to it one is the request object and the other is the response object.
The below table explain explains the attributes and their description of this method. The process ID is the mandatory attribute used to invoke this call.
Parameter | Description | Data type |
Status | The possible values are True and False which sends out the response value | String |
SubmitTime | The API submitted time | Date |
CompletionTime | The API Completion Time | Date |
ProcessID | The process id which is sent by the API to identify the process | String |
callbackURL | The url URL is passed from the API | string |
Code Block |
---|
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"processId":"ravindra.g@avankia.com-1461267097548/cleancopy"}' 'http://localhost:8080/webapi/appcode/repl-v4/ReplicationAPIDriver/checkStatus' |
Code Block |
---|
http://localhost:8080/webapi/appcode/repl-v4/ReplicationAPIDriver/checkStatus |
Code Block |
---|
{ "value": [ { "status": "completed", "submitTime": "2016-04-21T19:31:37Z", "completionTime": "2016-04-21T19:31:38Z", "processId": "ravindra.g@avankia.com-1461267097548/cleancopy", "callbackURL": "http://posttestserver.com/post.php", "errorMessage": [ null ] } ] } |
Code Block |
---|
200 |
Code Block |
---|
{ "date": "Thu, 21 Apr 2016 19:34:36 GMT", "server": "Apache-Coyote/1.1", "content-length": "244", "content-type": "application/json" } |