# All Companies

## zapiGetAllCompanies

<mark style="color:blue;">`GET`</mark> `https://{yourdomainname}.zaui.net/zapi/`

#### Request Body

| Name                                            | Type    | Description                                                                     |
| ----------------------------------------------- | ------- | ------------------------------------------------------------------------------- |
| zapiToken<mark style="color:red;">\*</mark>     | integer | Token that must be used for a reseller to communicate with the supplier system. |
| companyType<mark style="color:red;">\*</mark>   | integer | 1 for Commission type or 2 for Wholesale                                        |
| methodName<mark style="color:red;">\*</mark>    | string  | The method being called.                                                        |
| zapiUserId<mark style="color:red;">\*</mark>    | integer | Generated by the supplier system when a new contact is created.                 |
| zapiAccountId<mark style="color:red;">\*</mark> | integer | Generated by the supplier system.                                               |

{% tabs %}
{% tab title="200: OK " %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<response>
    <zapiVersion>2.1</zapiVersion>
    <error>0</error>
    <message>OK</message>
    <methodResponse>
        <methodName>zapiGetAllCompanies</methodName>
        <methodErrorCode>0</methodErrorCode>
        <methodErrorMessage/>
        <companies>
            <company>
                <companyName>Supplier Test System</companyName>
                <companyId>1</companyId>
                <companyType>Commission</companyType>
            </company>
            <company>
                <companyName>Zaui Software Ltd.</companyName>
                <companyId>456</companyId>
                <companyType>Commission</companyType>
            </company>
        </companies>
    </methodResponse>
</response>
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request" %}

```xml
<?xml version="1.0" encoding="utf-8"?>
<request>
	<zapiToken></zapiToken>
	<zapiAccountId></zapiAccountId>
	<zapiUserId></zapiUserId>
	<zapiMethod>
		<methodName>zapiGetAllCompanies</methodName>
		<companyType></companyType>
	</zapiMethod>
</request>
```

{% endtab %}

{% tab title="Response" %}

```html
<?xml version="1.0" encoding="utf-8"?>
<response>
	<zapiVersion>2.1</zapiVersion>
	<error>0</error>
	<message>OK</message>
	<methodResponse>
		<methodName>zapiGetAllCompanies</methodName>
		<methodErrorCode>0</methodErrorCode>
		<methodErrorMessage/>
		<companies>
			<company>
				<companyName></companyName>
				<companyId></companyId>
				<companyType></companyType>
			</company>
		</companies>
		<methodErrorCode>0</methodErrorCode>
		<methodErrorMessage></methodErrorMessage>
	</methodResponse>
</response>
```

{% endtab %}
{% endtabs %}
