Help with make-api-call returning response-mapping

Can someone help me with the code below. I want to make an api call and parse the returned JSON object to return an attribute.

The returned JSON object is below and I would like to parse out the T-Score.

{“Form”:[
{“Theta”:"-0.0809592429844071",“StdError”:“0.386368540487446”,“T-Score”:“49”,“SError”:“4”,“ItemCount”:“4”,“ItemErrors”:""}
]
}

The code below returns the complete object, I am trying to figure out how the response-mapping works.
Based on the json object about, I thought [“Form” 0 “T-Score”] would return 49.

Any help with the syntax would be greatly appreciated!

script below

(make-api-call api-call_0)

api-call_0
{:chat-display true,
:url
http://www.assessmentcenter.net/AC_API/2013-01/Scores/795B07C1-067E-4FBD-9B60-A57985E69B5D.json?Sleep116=Quite a bit&Sleep20=A little bit&Sleep44=Not at all&Sleep109=Poor”,
:type :api-call,
:request-type “get”,
:headers
[{:id “header-2”,
:name “Authorization”,
:value
{:type “text”,
:value
“Basic xxxxxx==”}}],
:body [],
:response-mapping
[{:attribute {:name “value”, :type “text”},
:path [“Form” 0 “T-Score”]}]}

])

The response mapping looks good overall, except for the quotation mark. Make sure you are using the current quotation mark ["Form" 0 "T-Score"] instead of [“Form” 0 “T-Score”].

Also, I notice that you have space in your URL which makes the URL invalid. You need to URL encode the url content. you can use online encoder for this e.g. https://www.urlencoder.org/

Thank you for your response.
I pasted the syntax you provided and the api still returns the complete json object.

Is there any documentation on making external api calls?
Specifically around the syntax and attributes (i.e. chat-display, :response-mapping, etc.)

Am I correct in assuming that if I use :response-mapping attribute, then the api call will just return the applied mapping and not the complete json object?

Thanks in advance!

:response-mapping stores the value find by path to the specified attribute. It does not affect what’s shown in the chatbot. :chat-display can be used to control whether you want to show the response json inside the conversation.

If you just want to show the value defined in the :repsonse-mapping, you can show the value by giving the attribute name.

Thanks for this information, is it possible that the api Content-Type needs to be set to a specific value in order for the response-mapping to parse the results.

My api Content-Type is set to text; charset=utf-8. I notice that your sample api Content-Type is set to application/json.

If the issues is with the Content-Type, does the platform contain any functionality for parsing json so that I can parse out the api call.

Thanks again for all your help!

The platform expects the response to be json. It will automatically parse json objects in the response. The response-mapping is used to indicate values you want to store as attributes from the response.