최근 검색
최근 검색 없음

okean123
가입한 날짜: 2022년 6월 06일
·
마지막 활동: 2022년 8월 31일
팔로잉
0
팔로워
0
총 활동 수
3
투표 수
0
가입 플랜
1
활동 개요
배지
문서
게시물
커뮤니티 댓글
문서 댓글
활동 개요
님의 최근 활동 okean123
okean123님이 에 댓글을 입력함
Sorry for the late response, but let me give you an example. In this example I am calling an API hosted on AWS, I will share the request logs to demonstrate the problem.
Let's start with the Zendesk request. This is what I put in Zendesk (Note that I added all implicitly required headers, they are just not in the screenshot and they are not relevant for the problem)
The above request leads to this being logged in our API:
'body': '"{\\"hello\\":\\"test\\"}"\n'
You can see that the quotes are double escaped. Also I am not exactly sure where that \n at the end is coming from, I don't think I have entered a new line, but it's probably not relevant anyway.
Now when I send a request using Javascript directly the outcome is different. A request example:
fetch(API_URL, {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
hello: "test"
})
});
This yields the following logs:
'body': '{"hello":"test"}'
Here it just logs the JSON as a string, the way it was sent. This is also what is expected and correct.
So my question would be, am I using the API call in the flow builer wrong and the JSON should be entered in a different format? Or is there a problem in the software that breaks the JSON when sending the HTTP requests?
Please let me know if you have any other questions about the example I provided.
댓글 보기 · 2022년 6월 21일에 게시됨 · okean123
0
팔로워
2
투표 수
0
댓글
okean123님이 에 댓글을 입력함
Hey there! I am currently working on including an external API into our bot. I am trying to do a POST request, but having troubles with the request body.
The format that I enter for the request body is normal JSON, like for example
{"test": "hello"}
Now the problem I encounter is that the external API that I use is returning that the request is invalid. When sending the exactly same request manually (for example through a browser console) the request is being processed correctly.
So my question is, do I have to format the JSON body in any specific way for Zendesk to correctly forward the request to the external API?
I have checked the Integration logs and it appears that the request body is being sent to the Zendesk servers as a string. Is it possible that when parsing the JSON string later into JSON some error occurs on your side?
The above seems like what is happening here to me, because when I checked the logs of one of our APIs that I tried to call using the tool, the request body contains not the actual JSON, but a stringified version of the JSON (with escaped quotation marks).
Any thoughts?
댓글 보기 · 2022년 6월 06일에 편집됨 · okean123
0
팔로워
0
투표 수
0
댓글