Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

"consumer_key_unknown" returned when accessing contacts

Started by Adobha Adobha -   in API Authentication

I am using XeroOAuth-PHP library. I have two scripts one to generate Invoice and the other to get Contacts.

The invoice script is working fine. However, the script to access the Contacts fails with Error: oauth_problem=consumer_key_unknown&oauth_problem_advice=Consumer%20key%20was%20not%20recognised

My code is:
$response = $XeroOAuth->request('GET', $XeroOAuth->url('Contacts?page=1', 'core'), array());

If I remove the page parameter, I get this Error: oauth_problem=signature_invalid&oauth_problem_advice=Failed%20to%20validate%20signature

I checked the consumer_key and secret in My Applications. They are same. The same key and secret works well with the other script.

How to fix this error?