Skip to main content

Hi All , I am looking to make a https api call to one of our application. the application works following way and require multiple json call to the application

1) https json request to login the application , below is an example of a working Curl request for the same.

e.g $CURL -s -k -c $COOKIE_FILE -H "Content-Type: application/x-www-form-urlencoded" -d "op=login&username;=<username>&password;=<password>&app;=api" -o login.json -X POST https://<application_hostname>/perl-bin/auth

2) https json request to perform your query for the data , below is an example of similar curl request.

$CURL -s -k -b $COOKIE_FILE -H "Content-Type: application/json" -d @<json_request> -X POST https://<application_hostname>/perl-bin/reportservice

3) https json request to logout , below is an example of similar curl request.

$CURL -s -k -b $COOKIE_FILE -H "$FORM_HEADER" -d "op=logout&app;=api" -o https://<application_hostname>/perl-bin/auth -X POST
$PROTOCOL$LOGIN_URL

can you please advise , how can this be implemented in FME

Hi , I am manage to perform step 1 and step 3 in the above ( successfully call the htppCaller for login and logout function ) . I would like to perform some json request to my server between step 1 and step 3 ( step 2 in above example ) . I am trying to use another Json caller here with a http POST request using a json file. but in second step , i am getting an error message -

 

_response_body (encoded: utf-8): {"success":null,"failure":{"errorCode":601,"errorMsg":"Invalid login"}}

 

I am not sure if it is because of non continuation of json request or for some other reason. can someone please reply.i really need some help here. please let me know if you need any other information to look into it.

 

 


Hi @amalik, I'm unclear what the request representations mean, but if the issue is that the login status cannot preserved in the session, saving Cookies could solve that. Try setting 'Yes' to the Save Cookies parameter in all the HTTPCallers.


Hi @amalik, I'm unclear what the request representations mean, but if the issue is that the login status cannot preserved in the session, saving Cookies could solve that. Try setting 'Yes' to the Save Cookies parameter in all the HTTPCallers.

 

Thanks @takashi , saving the kookies solved the problem.

Reply