API > Get companies
List companies
GET https://api.ticketbaiws.eus/empresas/
This method returns the list of registered companies
GET methods accept the parameters either in the body as a JSON payload or as a query string in the URL, as shown in the cURL example.
PARAMETERS
| id_licencia string optional To get the companies of a specific license | 999 |
| nif string optional To get the details of a specific company | B01000012 |
GET https://api.ticketbaiws.eus/empresas/
$ curl --request GET \
--url https://api.ticketbaiws.eus/empresas/ \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Token: xxx' \
--header 'Nif: 00000014Z'
--data '{"id_licencia": "999","nif":"B01000012"}'
$ composer require ticketbaiws/ticketbaiws-php
<?php
// Installation: composer require ticketbaiws/ticketbaiws-php
require 'vendor/autoload.php';
$cuenta = new \TicketbaiWS\Cuenta('xxx', '00000014Z'); // token de desarrollador y NIF de la cuenta
$r = $cuenta->listarEmpresas([
'id_licencia' => '999',
'nif' => 'B01000012',
]);
if ($r->isError()) {
echo $r->getMessageText();
} else {
print_r($r->getData());
}
$ python -m pip install requests
import requests
url = "https://api.ticketbaiws.eus/empresas/"
headers = {"Accept": "application/json", "Token" : "xxx", "Nif" : "00000014Z"}
response = requests.request("GET", url, headers=headers)
print(response.text)
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.ticketbaiws.eus/empresas/");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.ticketbaiws.eus/empresas/")
.get()
.addHeader("Accept", "application/json")
.addHeader("Token", "xxx")
.addHeader("Nif", "00000014Z")
.build();
Response response = client.newCall(request).execute();
{ } Response JSON
HTTP/1.1 200 OK
{
"result": "OK",
"return": [
{
"id": "999"
"id_licencia": "999",
"epigrafe": "",
"nombre_social": "Empresa de ejemplo S.L.",
"nombre_comercial": "Neumáticos Pepe",
"nif": "B01000012",
"direccion": "Calle de ejemplo 123",
"poblacion": "Vitoria-Gasteiz",
"provincia": "Álava",
"cp": "28080",
"email": "info@ejemplo.com",
"web": "www.ejemplo.com",
"diputacion": 1,
"token": "xxx",
"token_test": "xxx"
},
{
"id": "999"
"id_licencia": "999",
"epigrafe": "",
"nombre_social": "Empresa de ejemplo S.L.",
"nombre_comercial": "Neumáticos Pepe",
"nif": "B01000012",
"direccion": "Calle de ejemplo 123",
"poblacion": "Vitoria-Gasteiz",
"provincia": "Álava",
"cp": "28080",
"email": "info@ejemplo.com",
"web": "www.ejemplo.com",
"diputacion": 2,
"token": "xxx",
"token_test": "xxx"
}
],
"msg": null
}
