Wayne,
I suspect that the error may be caused by the Content-Type or Accept headers. Can you get an documentation for this service or contact their support? Also, are you running TeraScript Server 6.2 ? Robert From: Wayne Irvine [mailto:[email protected]] Sent: Thursday, June 13, 2013 10:06 PM To: [email protected] Subject: Re: TeraScript-Talk: PHP and cURL Wow, have never used the Web Call action before. Looks great. Having a few issues though. It's reporting a 400: Bad Request. I tried hardcoding the apiKey into the Web Call and it no longer reports that it is not seeing the apiKey but still fails. Is there something special about the way I define the values in the arguments or something I am missing? Currently I have: taken @@request$token apiKey @@request$rpx_api_key format json extended true Wayne Irvine On 14/06/2013, at 4:19 AM, Robert Shubert <[email protected] <mailto:[email protected]> > wrote: @URL or the WebCall action is used for this. If using the action, it’s straight forward to copy the URL in and, on the Post Data tab, create the 4 arguments (token, apiKey, format and extended). If you use @URL, you should build a small array of those arguments first and then pass them into POSTARGARRAY= Since 6.2.1 TeraScript uses cUrl under the hood. Robert From: Wayne Irvine [mailto:wayne@ <http://byteserve.com.au> byteserve.com.au] Sent: Thursday, June 13, 2013 1:04 AM To: <mailto:[email protected]> [email protected] Subject: TeraScript-Talk: PHP and cURL I'm converting a PHP file to Terascript and am a bit stuck on one part. The PHP file calls cURL: $post_data = array('token' => $token, 'apiKey' => $rpx_api_key, 'format' => 'json', 'extended' => 'true'); //Extended is not available to Basic. $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_URL, ' <https://rpxnow.com/api/v2/auth_info'> https://rpxnow.com/api/v2/auth_info'); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_FAILONERROR, true); $result = curl_exec($curl); if ($result == false){ echo "\n".'Curl error: ' . curl_error($curl); echo "\n".'HTTP code: ' . curl_errno($curl); echo "\n"; var_dump($post_data); } curl_close($curl); Any ideas how I would tackle this in Terascript? Would I use the File function or call cURL as an external? Wayne Irvine w: <http://www.byteserve.com.au/> http://www.byteserve.com.au/ p: +61 2 9960 6099 m: 0409 960 609 _____ To unsubscribe from this list, please send an email to <mailto:[email protected]> [email protected] with "unsubscribe terascript-talk" in the body. _____ To unsubscribe from this list, please send an email to <mailto:[email protected]> [email protected] with "unsubscribe terascript-talk" in the body. Wayne Irvine w: http://www.byteserve.com.au/ p: +61 2 9960 6099 m: 0409 960 609 _____ To unsubscribe from this list, please send an email to [email protected] <mailto:[email protected]> with "unsubscribe terascript-talk" in the body. ---------------------------------------- To unsubscribe from this list, please send an email to [email protected] with "unsubscribe terascript-talk" in the body.
