Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

How to send body of contact

Started by Jashanpreet grewal -   in API Authentication

Hello I have downloaded xer.screent cast and i am able to upload certidicate for my application . i am getting error while putting body in the response something like below can anyone help me on this

string putContactRequestBody = string.Format("<Contacts><Contact><Name>{0}</Name></Contact></Contacts>", contactName);

IConsumerRequest putContactRequest = consumerSession
.Request()
.ForMethod("PUT")
.ForUri(new Uri("https://api.xero.com/api.xro/2.0/Contacts"))
.WithFormParameters(new { xml = putContactRequestBody })

.SignWithToken(accessToken);
I am unabel to put putContactRequestBody in this during post call to xero api
Hi there,

I suggest you try using the Xero API .NET wrapper library . There are plenty of examples included and its much easier to work with than this older code example.

I've also removed the link to the older screencast in our code samples so others avoid that harder path in the future.
 

Tony Rule (Xero Staff)