This post explains the step-by-step process to create a transaction using Adeptia REST APIs.
You can modify the placeholder values (Transaction ID, Template ID, Partner ID, etc.) according to your environment.
Prerequisites
Before invoking the APIs mentioned below, ensure the following:
A valid
ACCESS_TOKENis required.The access token must be passed in the request headers.
Example Header:
Cookie: ACCESS_TOKEN=<your_access_token>Step 1: Create Transaction Definition
Method: POST
Endpoint:
http://localhost:8088/rest/transactionRequest Body:
{
"Transaction": {
"id": "",
"entityName": "Transaction Name",
"description": "Transaction Description",
"displayName": "",
"status": 602,
"type": 504,
"displayType": 504,
"company": {
"id": 1
},
"direction": 3200,
"srcAppType": "file:file:File",
"destAppType": "file:file:File",
"processType": 701,
"dataEncoding": "UTF-8",
"template": {
"id": "Template ID"
},
"xtype": "definition",
"stepName": "task1211 Transaction"
}
}Note: Save the Transaction ID returned in the response. This ID will be used in the next steps.
Step 2: Configure Partner and Network
Method: PUT
Endpoint:
/rest/transaction/your_transaction_idRequest Body:
{
"Transaction": {
"id": "Transaction ID received in Step 1",
"partner": {
"id": "11720628511728"
},
"project": null,
"networkId": "",
"textfield-6147-inputEl": "",
"searchpartner": "",
"partnerId": "11720628511728",
"status": 602,
"partnerName": "Partner_Test",
"paramInfo": "{\"network\":[{\"value\":\"\"}]}",
"network": {
"id": "11720628511726"
},
"xtype": "hubconfiguration",
"stepName": "Choose Partner",
"action": "noAuditTrail"
}
}Step 3: Configure Transaction Settings
Method: PUT
Endpoint:
/rest/transaction/your_transaction_idRequest Body:
{
"Transaction": {
"action": "noAuditTrail",
"activitiesLoggingRetention": "L",
"contactUser": "siddhant.tyagi@adeptia.com",
"emailNotificationFormat": "Default",
"id": "Transaction ID",
"loggingLevel": "ERROR",
"mapperExternalFunctionId": "",
"mapperValidatorId": "",
"notificationMode": 1900,
"paramInfo": "{\"network\":[{\"value\":\"\"}],\"mapperValidatorId\":\"\",\"mapperExternalFunctionId\":\"\",\"emailNotificationFormat\":\"Default\",\"loggingLevel\":\"ERROR\",\"activitiesLoggingRetention\":\"L\",\"repositoryFileRetention\":\"E\"}",
"repositoryFileRetention": "E",
"status": 602,
"stepName": "Transaction Settings",
"xtype": "transactionsettings"
}
}Step 4: Bind File Event to Transaction
Method: PUT
Endpoint:
/rest/transaction/eventregistry/file/your_transaction_id?aliasName=eventName&isLastStep=trueRequest Body:
{
"Transaction": {
"metadata": [
{
"id": "",
"activityId": "File Event ID",
"status": 602,
"sequenceType": "Trigger",
"type": "FileEvent",
"aliasName": "eventName",
"transaction": {
"id": "Transaction ID"
},
"action": "noAuditTrail"
}
],
"status": 602,
"xtype": "sourcefileform",
"stepName": "Select File Location"
}
}Important Notes
The File Event must be created before Step 4.
Use the File Event ID while binding the event to the transaction.
Ensure the correct Transaction ID is used in all PUT requests.
All API calls must include the
ACCESS_TOKENin the request headers.
Comments
0 comments
Please sign in to leave a comment.