mardi 30 juin 2020

Unable to create Contact with xero API . Giving 401 Unauthorized Error?

I am trying to create contact on Xero with help of Wrapper library webFox/laravel-xero-oauth2 which giving this error

[401] Client error: PUT https://api.xero.com/api.xro/2.0/Contacts?summarizeErrors=true resulted in a 401 Unauthorized response: {"Type":null,"Title":"Unauthorized","Status":401,"Detail":"AuthorizationUnsuccessful","Instance":"d5f847cb-199e-405e-982 (truncated...)

This library is creating account on xero perfectly but giving error when try to create Contact.

$apiInstance             = resolve(\XeroAPI\XeroPHP\Api\AccountingApi::class);
    
$contact = new \XeroAPI\XeroPHP\Models\Accounting\Contact;
$contact->setName('asdrtfgbhunjmkl,kmjhnbgbbnbjbbj');
$contact->setContactId('6d42f03b-181f-43e3-93fb-2025c0hjhe92');

$apiResponse = $apiInstance->createContacts($xeroCredentials->getTenantId() ,$contact,true);
$message = 'New Contact Name: ' . $apiResponse->getContacts()[0]->getName();



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3ieTwuz
via IFTTT

Aucun commentaire:

Enregistrer un commentaire