ExecuteAction
The Execute Action API is used to write records to the database. The developer can invoke the write API using:
http://<instanceurl>/oms/api/v1/{ResourceName}/executeAction/{ResourceActionName}
{ResourceActionName} is the resource action name from the Write tab in studio.
Sample input JSON:
{
"records"
: [
{
"Active"
:
true
,
"TypeName"
:
"Standard Enterprise"
,
"Description"
:
"Test-001"
,
"Address"
: {
"STREET3"
:
"Stret 3"
,
"ZIP"
:
"55555"
,
"COUNTRY"
:
"US"
,
"STREET1"
:
"Stret 1"
,
"STREET2"
:
"Stret 2"
},
"Phone"
:
"12345"
,
"TimeZoneId"
:
"America/New_York"
,
"DisplayName"
:
"Test 001"
,
"StartDayOfWeek"
:
"SUNDAY"
,
"Fax"
:
"12345"
,
"Name"
:
"Test-001"
}
]
}
records: Array of objects to write.
The response will be empty if there are no processing errors -
Example response if there are one or more errors during the write operation:
{
"errors"
: [
{
"TypeName"
:
"Sample Enterprise"
,
"Description"
:
"Test-001"
,
"Address"
: {
"STREET3"
:
"Stret 3"
,
"ZIP"
:
"55555"
,
"COUNTRY"
:
"US"
,
"STREET1"
:
"Stret 1"
,
"STREET2"
:
"Stret 2"
},
"Error"
: {
"errorMessage"
:
"Invalid custom model (or transaction) name: Sample Enterprise"
,
"majorCode"
:
80000
,
"minorCode"
:
2
},
"Name"
:
"Test-001"
,
"ModelLevelType"
:
"Enterprise"
,
"Active"
:
false
,
"Phone"
:
"12345"
,
"TimeZoneId"
:
"America/New_York"
,
"DisplayName"
:
"Test-001"
,
"StartDayOfWeek"
:
"SUNDAY"
,
"ValueChainId"
:
100
,
"Fax"
:
"12345"
}
]
}
For sample requests and responses, please check the swagger documentation.