Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

json response

Hi,
i have to fetch json response from url using cookie concept.
I have tried with using only trestclient step there is no cookie option is available and later on i tried with tfilefetch component to use the cookie concept it is giving 200 as a response but i am not able to get any response from the tfilefetch?
1) I haved logged in using tfilefetch component using tfilefetch with cookie concept i,e giving 200 as response code.
2) I am trying to get json response from the one more url using tfilefetch component it is giving as 200 response code but in that file only html content is generated instead of response code using existing cookies which i have used it in step 1.
Output log from two tfilefetch components is
Status Line: HTTP/1.1 200 OK
*** Response Header ***
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Language: en-US
Content-Length: 3072
Vary: Accept-Encoding
Date: Thu, 09 Jan 2014 13:34:02 GMT
Status Line: HTTP/1.1 200 OK
*** Response Header ***
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Language: en-US
Content-Length: 3072
Vary: Accept-Encoding
Date: Thu, 09 Jan 2014 13:34:07 GMT
How can we do it ? Is there any work around to do this.. Please give ur suggestions.
Labels (4)
18 Replies
Anonymous
Not applicable
Author

Payload: {"items":{"user_id":"swati1036","email":"w@serenity.io","name":"Serenity Washburne","signed_up_at":1392731325,"last_seen_ip":"1.2.3.6","last_seen_user_agent":"Mozilla\/5.0(Macintosh; Intel Mac OS X 10.9"}}

This is the payload request send from tRestClient, is it the right data what your server expects?
Anonymous
Not applicable
Author

same json data is sending by the chrome Rest Client and it was working fine so i think intercom is accepting this data.
Anonymous
Not applicable
Author

The only difference of chrome Rest client and tRestClient is that - in tXMLmap, i have to fetch all fields in the item tag.
Anonymous
Not applicable
Author

image is this - 
0683p000009MCYB.jpg
Anonymous
Not applicable
Author

image is this - 
Anonymous
Not applicable
Author

Good day
If your webapi accept Json, you should use the field : String and not the field : body in your txmlmap.
If your webapi accept xml then your current solution is perfect.
Please show me the configuration of the tRestClient
Best regards,
Alfonso Borre
Anonymous
Not applicable
Author

Hi,
Thanks for the reply.
But, i am using tRest for sending users and have success in fixed json data.
I have to send users dynamically, then i am using this flow - 
tMSSqlOutput (get one table)
->tJavaRow set context (context.c_user_id = input_row.user_id;
                                   context.c_name = input_row.name;
                                   context.c_email = input_row.Email 0683p000009MA9p.png
->tRest 
(Headers - "Accept"- "application/json"
"Content-Type"-"application/json"
"Authorization"-"Basic cDRsdDQ0emQ6ZTQ1ZjczZDYwOWRiMGUxNzcwZjI4MDgxZDcxMGM5ODBkZDg4MDIyMA=="
HTTP Body -
"{
  \"user_id\":+context.c_user_id+,
  \"email\": +context.c_email+,
  \"name\": +context.c_name+
}"
)
Intercom is not accepting single quotes so here i am using this \" in place of single quote. So not able to pass context value this code is always send label as it is.
Can you please help me.
Thanks in advance.
Anonymous
Not applicable
Author

And can you please elaborate this line "If your webapi accept Json, you should use the field : String and not the field : body in your txmlmap"?
or do you have example on it because intercom is accepting& content-Type is json data.
I can also work to do this.
Thanks.
Anonymous
Not applicable
Author

Hi ingenioso,
I need a example for txmlmap for json data because now i am sending my users data in body field and string field is blank. body tag is always returning xml data but intercom needs json data so how can i achieve this?
Please help me on this.
Thanks.