Data Params |
As the SalesForceToFileSystem is a post request, The body payload should be in below format
{ "sfConfig": { "username": "string", "password": "string", "securityToken": "string", "sessionId": "string", "endpointURL": "string" }, "targets": [{ "host": "string", "port": "string", "filesystemType": "string", "username": "string", "password": "string", "folder": "string", "bucket": "string", "targetFileName": "string", "region": "string" }], "queryToTheAttachment": "string" } Example As the SalesForceToFileSystem is a post request, The body payload should be in below format
{ "sfConfig": { "username": "john@avankiajohn@avankia.com", "password": "123456", "securityToken": "00P2800000lT3mqfbEw74CxeC8kcxLK2zUnAlcp3", "sessionId": "", "endpointURL": "https://ap2.salesforce.com/services/Soap/u/39.0" }, "targets": [ { "host": "accountingaccount.avankia.com", "port": "21", "filesystemType": "ftp", "username": "anil.b@avankiab@avankia.com", "password": "123456", "folder": "roottestFiles", "bucket": "string", "targetFileName": "" "region": "" } ], "queryToTheAttachment": "select Name,Body from attachment where id = '00P2800000lT3mq'" }
|
---|
Success Response |
The status code on success reponse should be 200.
Example Code : 200 Response Body : [ { "id": "testFiles/Sampledata.txt", "newid": "testFiles/Sampledata.txt", "success": true, "errors": [null] } ]
|
---|
Error Response |
Most endpoint will have many ways they can fail. Below are some of the known error reponse code and response body. Code 401 : Unautorized access Code 403 : Forbidden error Example Code : 401 Response Body : [ { "success": false, "errors : [ "INVALID_LOGIN: Invalid username, password, security token; or user locked out."] } ]
|
---|
Sample Call |
The below is the sample call from the endpoint. This would make the API call more predictable for the reader.
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' -d ' { "sfConfig":{ "username":"anil.b@john@avankia.com", "password":"@test123", "securityToken":"fbEw74CxeC8kcxLK2zUnAlcp3", "sessionId":"https://ap2.salesforce.com/services/Soap/u/39.0", "endpointURL":"string"}, "targets":[{ "host":"107account.180avankia.12.172com","port":"21", "filesystemType":"ftp", "username":"dbsyncftp@hrnewspadanil.b@avankia.com", "password":"AvankiaFTP789()123456", "folder":"testFiles", "bucket":"", "targetFileName":"", "region":"" }], "queryToTheAttachment":"select Name,Body from attachment where id = \u002700P2800000lT3mq\u0027'00P2800000lT3mq"
}'
'https://api.mydbsync.com:443/api/appcode/v1/sftofilesystem/upsertFile'
|
---|