Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

Connect to Xero from an other app like 1C

Started by Alex Zavyalov -   in API Authentication

Hello, friends.
I am trying to connect to Xero.
1. I made certificate. And I put it into Windows certificates.
2. I registered my App.
3. I coded my require, but I got answer 401.

Please, see my code. Of course, I know that you can not know this language, but probably you can see something wrong.

stringServerName = "api.xero.com";
stringApiName = "/api.xro/2.0/Organisations";

ssl3 = New OpenSSLSecureConnection(
New WindowsClientCertificate(),
New WindowsCertificationAuthorityCertificates());

HTTP = New HTTPConnection(stringServerName,,,,,,ssl3);

HTTPRequest = New HTTPRequest();
HTTPRequest.ResourceAddress = stringApiName;

HTTPRequest.Headers.Insert("AppType", "PRIVATE");
HTTPRequest.Headers.Insert("UserAgent", "second-CDPB2R");
HTTPRequest.Headers.Insert("ConsumerKey", "YEKMCVHYRQTHVHUDNW5585Q1C4P3XF");
HTTPRequest.Headers.Insert("ConsumerSecret", "VE2GFOSS8Y6O1RW3IAPKXILRNGX8BB");

AnswerHTTP = HTTP.CallHTTPMethod("GET", HTTPRequest);

Message(AnswerHTTP.StatusCode);

Please, if you have any guesses, please answer me right here or on email.

P.S.: Don`t worry about keys, I have only demo Xero and I have no data there.