Reputation: 35
how to create new contacts in Xero using API?
i have tried this API - https://api.xero.com/api.xro/2.0/Contacts but i always get this error : "oauth_problem=consumer_key_unknown&oauth_problem_advice=Consumer key was not recognised."
I don't know how to pass client id and client secret or access token in API?
passing parameter in the header is not working -
curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Basic " . base64_encode('75F16AECC7F749E08D1822B32CD110EB:lJ_h1cG7dvE5xIAXDWyFDcmGQPqtZOlHzfAzw0ImdLPKOxL5'), 'Content-Type: application/json' ]);
please help
Upvotes: 0
Views: 979
Reputation: 866
Xero uses the OAuth2 authorization flow. Broadly speaking, you'll need to:
The full details are described in the Xero Developer docs.
Upvotes: 1