Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
2 replies
Subscribers
7 subscribers
Views
2138 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
We are trying to use RESTFUL service to send JSON data to Appian. The
ganeshp
Certified Senior Developer
over 9 years ago
We are trying to use RESTFUL service to send JSON data to Appian.
The parameter is defined of any type which is a CDT. So, in the expression rule based on 'messageid' shared in request header, the request detail will be sent in response.
= httppostwithresponse(
endpoint: URL(),
paramNames: {},
paramValues: {},
headerNames: { cons!HEADER },
headerValues: {
(
TraceId: "",
SourceIpAddress: "",
SourceHostName: "",
RelayedBy: "",
ApiVersion: "",
SessionId: "",
Originator: "",
UserRole: "",
OperationName: "",
processId: ""
)
},
body: "
{
""request"": {
""gtwyReqHdr"": {
""TraceId"": ""String"",
""MessageId"": ""MESSAGE"",
""SourceIpAddress"": ""String"",
""SourceHostName"": ""String"",
""SourceTimestamp"": ""YYYY-DD-MM hh:mm:ss"",
""RelayedBy"": ""String"",
""ApiVersion"": ""String"",
...
OriginalPostID-180232
OriginalPostID-180232
Discussion posts and replies are publicly visible
Parents
0
ganeshp
Certified Senior Developer
over 9 years ago
... ""SessionId"": ""String"",
""Originator"": ""String"",
""UserRole"": ""String"",
""UserId"": ""String"",
""OperationName"": ""String""
},
""gtwyReqDtl"": {
""messageIP"": {
""EMPLOYEEDATA"": [{
""EmpID"": "&ri!employee.EmpID&",
""Name"": "&ri!employee.Name&",
""Role"": "&ri!employee.Role&"
}
}]
}
}
}
}"
)
I am able to get a response when the fields are given hardcoded values within the quotes say “123” or when the rule inputs are individual fields and not a CDT.
When it is a CDT I get the below error –
Expression evaluation error at function 'httppostwithresponse' parameter 6 [line 22]: Invalid index: Cannot index property 'EMPID' of type Text into type Text
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
ganeshp
Certified Senior Developer
over 9 years ago
... ""SessionId"": ""String"",
""Originator"": ""String"",
""UserRole"": ""String"",
""UserId"": ""String"",
""OperationName"": ""String""
},
""gtwyReqDtl"": {
""messageIP"": {
""EMPLOYEEDATA"": [{
""EmpID"": "&ri!employee.EmpID&",
""Name"": "&ri!employee.Name&",
""Role"": "&ri!employee.Role&"
}
}]
}
}
}
}"
)
I am able to get a response when the fields are given hardcoded values within the quotes say “123” or when the rule inputs are individual fields and not a CDT.
When it is a CDT I get the below error –
Expression evaluation error at function 'httppostwithresponse' parameter 6 [line 22]: Invalid index: Cannot index property 'EMPID' of type Text into type Text
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data