
UpdateContactAsync not clear
While building my own Wrapper I am confused with one of the API methods
The UpdateContactAsync mehod allows the update of a single Contact or a list of them
https://developer.xero.com/documentation/api/contacts#POST
For a single contact I dont see a problem
The call requires the Contacts object with a single contact and the contactID
var list = new List<Xero.NetStandard.OAuth2.Model.Accounting.Contact>();
list.Add(contact);
var header = new Xero.NetStandard.OAuth2.Model.Accounting.Contacts();
header._Contacts = list;
var task = Task.Run(() => xeroAPI_A.UpdateContactAsync(AccessToken, TenantID, contact.ContactID.Value, header));
BUT when updating multiple contacts you shouldnt need to pass a contact ID because they are all different!
So I expected a UpdateContactsAsync but there is none
var header = new Xero.NetStandard.OAuth2.Model.Accounting.Contacts();
header._Contacts = contacts;
var task = Task.Run(() => xeroAPI_A.UpdateContactAsync(AccessToken, TenantID, new Guid(), header));
I have not tested this yet but it don't look right!
The UpdateContactAsync mehod allows the update of a single Contact or a list of them
https://developer.xero.com/documentation/api/contacts#POST
For a single contact I dont see a problem
The call requires the Contacts object with a single contact and the contactID
var list = new List<Xero.NetStandard.OAuth2.Model.Accounting.Contact>();
list.Add(contact);
var header = new Xero.NetStandard.OAuth2.Model.Accounting.Contacts();
header._Contacts = list;
var task = Task.Run(() => xeroAPI_A.UpdateContactAsync(AccessToken, TenantID, contact.ContactID.Value, header));
BUT when updating multiple contacts you shouldnt need to pass a contact ID because they are all different!
So I expected a UpdateContactsAsync but there is none
var header = new Xero.NetStandard.OAuth2.Model.Accounting.Contacts();
header._Contacts = contacts;
var task = Task.Run(() => xeroAPI_A.UpdateContactAsync(AccessToken, TenantID, new Guid(), header));
I have not tested this yet but it don't look right!
1
Replies

Found a similar issue with
UpdateItemAsync
Apparently you can specify a list of Items to update but you need to provide an ItemID in the call!
UpdateItemAsync
Apparently you can specify a list of Items to update but you need to provide an ItemID in the call!