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
8 replies
Subscribers
7 subscribers
Views
2859 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
Hello, I am trying to Read From and Write To a Web API , as I am new to it
deepthig
over 9 years ago
Hello,
I am trying to Read From and Write To a Web API , as I am new to it I have followed the basic example at
forum.appian.com/.../Connector_Functions.html
But it gave me an error
"Cannot index property 'body' of type Text into type Text"
did anyone happen face the same issue???
Thanks in advance
OriginalPostID-188881
OriginalPostID-188881
Discussion posts and replies are publicly visible
0
Tom Ryan
Appian Employee
over 9 years ago
It sounds like you may have an error in an expression, possibly passing the wrong type as a parameter. Can you attach the expression?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
deepthig
over 9 years ago
Hi Tom ... here is the expression
load(
local!countIoGroupUrl: "
count.io/.../",
local!count: bind(
get: a!fromJson(
jsonText: a!httpQuery(
url: local!countIoGroupUrl & "example"
).result.body
).count,
set: a!httpWrite(
url: _,
method: "POST"
)
),
a!dashboardLayout(
firstColumnContents: {
a!textField(
label: "Counter",
instructions: "Use the +1 and -1 buttons below to increase or decrease the counter above",
value: local!count,
readOnly: true
),
a!buttonLayout(
secondaryButtons: {
a!buttonWidget(
label: "- 1",
value: local!countIoGroupUrl & "example-",
saveInto: local!count
),
a!buttonWidget(
label: "+ 1",
value: local!countIoGroupUrl & "example+",
saveInto: local!count
)
}
)
}
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tom Ryan
Appian Employee
over 9 years ago
It appears that count.io is currently not available. You will need to test with a different API.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
deepthig
over 9 years ago
I have created a sample API in my appian server it self and tried but still I get the same error...we are on cloud does that make any difference???
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tom Ryan
Appian Employee
over 9 years ago
It should not. To rule out any issues with exposing the web service, it might be easier to try with an external API.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
deepthig
over 9 years ago
Tom, I am trying to work with a!httpWrite function as my requirement is to write back through an external API is there any way to do it ??
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
deepthig
over 9 years ago
I have created a Web API with templates provided and while connecting the URL through a!httpQuery I am facing the below issue
Interface Definition: Not a valid component. Received: [success:false,result:,error:[code:[category:0,namespace:1,detail:0],title:HTTP error connecting to
Test.appiancloud.com/.../1.1
401 Unauthorized,detail:No details available],@attributes:[@anyAttribute:[_dirty:false,_bannerText:,_refresh:]]]
while the URL is perfectly accessible in browser
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tom Ryan
Appian Employee
over 9 years ago
Based on the Unauthorized error, it seems that you may not be supplying the correct credentials. It is most likely working through the browser because you already have an active session with the site. Another good way to test web service calls externally to Appian is with SoapUI:
http://www.soapui.org/
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel