rest error 2002

Hi

I have a problem since last week with my rest requests .all worked fine before , I opened a ticket which was closed by kate http://support.backendless.com/t/rest-error-2002 . but that didn’t resolve the issue.

if you could

I am testing with the autogenerated code from the backendless rest console and still getting the same issue , please advise?

The service responds with Array ( [code] => 2002 [message] => Version is disabled or provided wrong application info (application id or secret key)

code from the restconsole is

$url = ‘https://api.backendless.com/v1/data/Users’;

$headers = array(
‘Content-Type : application/json’,
‘application-id : 3FD54743-9943-C4CE-FF66-BD6DF7BF4E00’,
‘secret-key : secret removed’
);

// Open connection
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “GET”);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute request
$result = curl_exec($ch);

// Close connection
curl_close($ch);

print_r(json_decode($result, true));

Hi Kalpesh,

I just found the bug in our code generation for REST console. You should exclude the whitespaces from the headers, so, for example, from ‘application-id : 3FD54743-9943-C4CE-FF66-BD6DF7BF4E00’ it should become ‘application-id:3FD54743-9943-C4CE-FF66-BD6DF7BF4E00’ (and the same should be done for all the other headers).

We shall fix it in the REST console as soon as possible.

Thanks for being insistent!