Lokendra Singh Panwar
Lokendra Singh Panwar

Reputation: 511

How get all organization name in xero api for private app?

I am new in API integration

Here is my request code-

<li><a href="?organization=1">Organization</a></li>
 if (isset($_REQUEST['organisation'])) {
       $response = $XeroOAuth->request('GET', $XeroOAuth->url('Organisation', 'core'), array('page' => 0));
       if ($XeroOAuth->response['code'] == 200) {
           $organisation = $XeroOAuth->parseResponse($XeroOAuth->response['response'], $XeroOAuth->response['format']); 
       print_r($organisation);
           echo "Organisation name: " . $organisation->Organisations[0]->Organisation->Name;
       } else {
           outputError($XeroOAuth);
       }
   }

Here is output code-

Organisation name: Cadeo

I want to get all organization name?

Upvotes: 0

Views: 370

Answers (2)

giraffe.guru
giraffe.guru

Reputation: 520

A private app can only be connected to one organisation in Xero.

If you want to connect your app to more than one organisation, you will need to create a public (or partner) app.

Upvotes: 1

Bhavjot
Bhavjot

Reputation: 652

Organisation object in Xero has various properties. 'Name' is one of them. What you might be referring to is full name or Registered name. It can be accessed through "LegalName" property.

For all the properties or values you can get for Organisation, check the following documentation

Upvotes: 2

Related Questions