Autenticacion 6 metodos Base de conocimiento 3 metodos Inventario 6 metodos Ventas 10 metodos Compras 4 metodos Contabilidad 5 metodos Reporteria 5 metodos

Base de conocimiento

Contenido de ayuda en modo solo lectura para todas las empresas.

Base URL: https://troyansys.com/api/v1

GET

Listar categorias de ayuda

Obtiene categorias con contador de articulos.

Endpoint Bearer
https://troyansys.com/api/v1/knowledge-base/categories
Endpoint API Key
https://troyansys.com/api/v1/company/knowledge-base/categories

Ejemplos de uso

Bearer
cURL
curl -X GET "https://troyansys.com/api/v1/knowledge-base/categories" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Company-Id: 1"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/knowledge-base/categories', [
    'headers' => [
        'Accept' => 'application/json',
        'Authorization' => 'Bearer {token}',
        'X-Company-Id' => '1'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/knowledge-base/categories");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "{token}");
request.Headers.Add("X-Company-Id", "1");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
API Key
cURL
curl -X GET "https://troyansys.com/api/v1/company/knowledge-base/categories" \
  -H "Accept: application/json" \
  -H "X-API-Key: {api_key_empresa}"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/knowledge-base/categories', [
    'headers' => [
        'Accept' => 'application/json',
        'X-API-Key' => '{api_key_empresa}'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/knowledge-base/categories");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Add("X-API-Key", "{api_key_empresa}");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

Respuesta esperada

{
    "data": [
        {
            "code": "sales",
            "name": "Ventas y facturacion",
            "articles_count": 2
        },
        {
            "code": "inventory",
            "name": "Inventario y productos",
            "articles_count": 2
        }
    ]
}
GET

Listar articulos de ayuda

Lista articulos por busqueda y categoria.

Endpoint Bearer
https://troyansys.com/api/v1/knowledge-base/articles
Endpoint API Key
https://troyansys.com/api/v1/company/knowledge-base/articles

Parametros Query

Campo Tipo Req. Descripcion
q string No Texto de busqueda libre.
category string No Codigo de categoria.
page integer No Pagina de resultados.
per_page integer No Cantidad por pagina (1 a 100).

Ejemplos de uso

Bearer
cURL
curl -X GET "https://troyansys.com/api/v1/knowledge-base/articles?category=sales&q=anticipo" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Company-Id: 1"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/knowledge-base/articles?category=sales&q=anticipo', [
    'headers' => [
        'Accept' => 'application/json',
        'Authorization' => 'Bearer {token}',
        'X-Company-Id' => '1'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/knowledge-base/articles?category=sales&q=anticipo");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "{token}");
request.Headers.Add("X-Company-Id", "1");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
API Key
cURL
curl -X GET "https://troyansys.com/api/v1/company/knowledge-base/articles?category=sales&q=anticipo" \
  -H "Accept: application/json" \
  -H "X-API-Key: {api_key_empresa}"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/knowledge-base/articles?category=sales&q=anticipo', [
    'headers' => [
        'Accept' => 'application/json',
        'X-API-Key' => '{api_key_empresa}'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/knowledge-base/articles?category=sales&q=anticipo");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Add("X-API-Key", "{api_key_empresa}");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

Respuesta esperada

{
    "data": [
        {
            "slug": "cobros-anticipos-y-excedentes",
            "title": "Cobros, anticipos y excedentes",
            "category_code": "sales"
        }
    ],
    "meta": {
        "current_page": 1,
        "last_page": 1,
        "per_page": 20,
        "total": 1
    }
}
GET

Ver articulo de ayuda

Devuelve detalle de articulo, secciones y guias relacionadas.

Endpoint Bearer
https://troyansys.com/api/v1/knowledge-base/articles/cobros-anticipos-y-excedentes
Endpoint API Key
https://troyansys.com/api/v1/company/knowledge-base/articles/cobros-anticipos-y-excedentes

Ejemplos de uso

Bearer
cURL
curl -X GET "https://troyansys.com/api/v1/knowledge-base/articles/cobros-anticipos-y-excedentes" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}" \
  -H "X-Company-Id: 1"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/knowledge-base/articles/cobros-anticipos-y-excedentes', [
    'headers' => [
        'Accept' => 'application/json',
        'Authorization' => 'Bearer {token}',
        'X-Company-Id' => '1'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/knowledge-base/articles/cobros-anticipos-y-excedentes");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "{token}");
request.Headers.Add("X-Company-Id", "1");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
API Key
cURL
curl -X GET "https://troyansys.com/api/v1/company/knowledge-base/articles/cobros-anticipos-y-excedentes" \
  -H "Accept: application/json" \
  -H "X-API-Key: {api_key_empresa}"
PHP (Guzzle)
<?php

$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://troyansys.com/api/v1/company/knowledge-base/articles/cobros-anticipos-y-excedentes', [
    'headers' => [
        'Accept' => 'application/json',
        'X-API-Key' => '{api_key_empresa}'
    ],
]);

$data = json_decode((string) $response->getBody(), true);
print_r($data);
.NET (HttpClient)
using System.Net.Http.Headers;
using System.Text;

var httpClient = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://troyansys.com/api/v1/company/knowledge-base/articles/cobros-anticipos-y-excedentes");
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
request.Headers.Add("X-API-Key", "{api_key_empresa}");

var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

Respuesta esperada

{
    "data": {
        "slug": "cobros-anticipos-y-excedentes",
        "title": "Cobros, anticipos y excedentes",
        "category_code": "sales",
        "sections": [
            {
                "title": "Cruce de anticipos",
                "paragraphs": [
                    "Al iniciar cobro..."
                ]
            }
        ],
        "related": [
            {
                "slug": "crear-comprobante-venta-correcto",
                "title": "Como crear un comprobante de venta correctamente"
            }
        ]
    }
}