2022

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
What is REST API?

The ApiCode distribution REST API provide provides programmatic access to read and write 'Read' and 'Write' replication data. The REST API identifies the application and its users using OAUTH   ; and, responses are available in jsonJSON.  We have used SWAGGER editor for the end users to make the API calls so that they can try out APIs exposed by API management platform. 

Click Herefor accessing to access the CW-API management platform for unregistered user.

Checklist Before Getting Started Started: 

  1. user User should have the release of 4.2.9 or later.
  2. Have a valid credentials of DBSync API management platform platform. 
  3. Have a valid credentials of bitbucket.

There are various API methods list which that are exposed for in this release , we . We will be adding more methods in the upcoming releases. 

...

ApiCode-Distribution

The ApiCpdeApiCode-Distribution distribution is an API which that is used to deploy ApiCode based rest on REST services from a git Git repository to the underlying ApiServerApi management server.

The Tables below tables explains the various model schema and model schemas and attributes which that form the model class 

...

SaleForceFile params 

...

class: 

ApiCode Server Params

Parameter

Description

DataType

Data Type

sfConfig

apiCodeServerUsername(

Optional

optional)

The

salesforce credentials which are required to connect to the salesforce instance

Salesforce

fsConfig

Username of the ApiCode server instance.

String

apiCodeServerPassword(optional)

The

FTP server credentials which are required to connect to FTP server for downloading a file

FTP

queryToTheAttachment

Password of the ApiCode server instance.

String 

environment(optional)

The salesfoce object to specify a file to be downloaded

String

...

User has the flexibility to define his/her environment in which s/he wishes to deploy the code base.

String

Git Repository Params

Parameter

Description

DataType

Data Type

username

url(

Required

optional)

The

username

Git repository url of the

salesforce instance

user from which

the user wishes to retrieve information from where the file to be downloaded

string

password(Required)

The password of the salesforce instance

string 

securityToken(Required)

A security Token is a case sensitive alpha numeric code that you append to the password or enter in a separate field in client application

string

sessionID(optional)

An Identifier for current user in the current context

string

endpointURL(Required)

The url to access the salesforce application

string

...

FileSystem Params

...

Parameter

Description

DataType

host(Required)

Hostname of ftp server

string

port(Required)

port number of ftp server

string

filesystemType

The possible supported FTP are Sftp, FTPS and plain FTP

string

username(Required)

ftp server username

string

password(Required)

ftp server password

string

folder(Required)

path within ftp server to place the file

string

he would like to deploy the code base.

String

branch(optional)

The branch inside of a repository from which the user wishes to deploy the code base.

String

username(optional)

Valid User name of the Git repository

String

password(optional)

Valid password of the Git repository

String

Run Properties Params

Below table gives the attribute list of the response class

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 is passed from the API

string

...

Example For UnSucessful Download 

...

Curl

...

ServiceURL(optional)

The website url to access the service.

String

docURL(optional)

Retrieves the URL of the file in the web layout directory.

Date

SwaggerURL(optional)

The swagger url is the return type on which the response is listed. 

Date

status(optional)

The possible values are True and False. It sends out the response value.

String

errorMessage(optional)

In case the status value is False, an error message is returned. 

Array[string]

Example of an Unsuccessful Deployment
Curl
Code Block
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"sfConfigappCodeServerUsername":{"username":""anil.b@mydbsync.com","passwordappCodeServerPassword":"dbsync2015","securityTokenenvironment":"dev","sessionIdurl":"","endpointURL":""},
"fsConfig":{"host":"","port":"","filesystemType":"","username":"https://sureshullagaddi@bitbucket.org/dbsync/amazons3.git","branch":"dev","username":"suresh.u@avankia.com","password":"suresh@12345","folder":""},"queryToTheAttachment":""}' 'https://apistaging.mydbsync.com:443/api/appcode/v1/sftofilesystemappcode-distribution/upsertFilegitCompile'

Request URL
Code Block

https://apistaging.mydbsync.com:443/api/appcode/v1/sftofilesystem/upsertFile

appcode-distribution/gitCompile.
Response Body
Code Block

{
  "error": "AppCode:sftofilesystemappcode-distribution does not exist, Please check your URL".
}
Response Code
Code Block
  200.
Response Header
Code Block

{
 "access-control-allow-origin": "*",
 "date": "MonFri, 2024 Feb 2017 1813:4423:54 GMT",
 "server": "Apache/2.4.25 (Amazon) OpenSSL/1.0.1k-fips",

"connection": "Keep-Alive",
 "keep-alive": "timeout=5150, max=10092",

"content-length": "7278",
 "content-type": "application/json"

}