Base URL https://api.afer.pro Referencia aferapp.com Reservar demo

Primeros pasos

Cómo se llama a la API, qué formato tiene el cuerpo y cómo hacer tu primera petición en un minuto.

Todos los endpoints se llaman por HTTP POST con un cuerpo JSON, la cabecera Content-Type: application/json y tus claves API en las cabeceras X-API-KEY y X-API-SECRET. El nombre del endpoint va en la ruta y no distingue mayúsculas de minúsculas: /crearFactura y /crearfactura son equivalentes.

curl -X POST 'https://api.afer.pro/crearContacto' \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: afer_tk_TU_TOKEN' \
  -H 'X-API-SECRET: afer_sk_TU_SECRET' \
  -d '{
    "contacto": {
      "persona_contacto": "Maria Ferrer",
      "email_contacto": "maria@ejemplo.com"
    }
  }'
<?php

$data = [
  'contacto' => [
    'persona_contacto' => 'Maria Ferrer',
    'email_contacto'   => 'maria@ejemplo.com',
  ],
];

$ch = curl_init('https://api.afer.pro/crearContacto');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'X-API-KEY: afer_tk_TU_TOKEN',
    'X-API-SECRET: afer_sk_TU_SECRET',
]);

$respuesta = json_decode(curl_exec($ch), true);
curl_close($ch);
const respuesta = await fetch('https://api.afer.pro/crearContacto', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'afer_tk_TU_TOKEN',
    'X-API-SECRET': 'afer_sk_TU_SECRET'
  },
  body: JSON.stringify({
    contacto: {
      persona_contacto: 'Maria Ferrer',
      email_contacto: 'maria@ejemplo.com'
    }
  })
});

const resultado = await respuesta.json();

El resto de la guía

Cada pieza común a toda la API, en su propia página.