Eventos
Recurso | Descrição |
---|---|
GET /api/v1/events/:id | Informações do evento |
GET /api/v1/events | Listar eventos |
Modelo de Dados
Parâmetro | Obrigatório | Tipo | Tamanho | Descrição |
---|---|---|---|---|
id | N/A | Integer | ID do evento | |
code | N/A | String | 255 | Código do evento. Ver possíveis valores na lista de eventos |
data | N/A | Hash | Mais informações relativas ao evento. Ver possíveis valores em Payloads | |
occurred_at | N/A | DateTime | Data e hora de quando o evento ocorreu. | |
bank_billet_account_id | N/A | Integer | ID da Carteira de Cobrança. | |
resource_owner_id | N/A | Integer | ID do Objeto associado ao evento | |
created_at | N/A | DateTime | Data e hora de criação do evento | |
updated_at | N/A | DateTime | Data e hora de atualização do evento |
Informações do evento
GET /api/v1/events/:id
Exemplo
Requisição:
curl -i \ -H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \ -H 'Content-Type: application/json' \ -H 'User-Agent: MyApp (myapp@example.com)' \ -X GET 'https://api-sandbox.kobana.com.br/v1/events/1'Resposta:
HTTP/1.1 200 OK Date: Fri, 17 Oct 2014 19:46:16 GMT Status: 200 OK Content-Type: application/json; charset=utf-8 ... { "id": 223, "code": "transaction.created", "bank_billet_account_id": 2 "resource_owner_id":68, "data": { "object": { "id": 68, "amount": -5, "created_at": "2015-03-17", "description": "Boleto Banc\u00e1rio 862", "kind": "fee", "processed_at": null, "sent_at": null, "status": "unprocessed", "credit_at": "2015-03-26" } }, "occurred_at": "2015-03-17T21:37:27.000-03:00", }
Listar eventos
GET /api/v1/events
Parâmetro | Obrigatório | Tipo | Descrição |
---|---|---|---|
page | Não | Number | Número da Página |
per_page | Não | Number | Quantidade de registros por página |
resource_owner_id | Não | Number | ID do objeto que gerou o evento. Ex. ID do boleto. |
code | Não | String | Código do evento |
occurred_at_from | Não | String | Início da data de ocorrência do evento. |
occurred_at_to | Não | String | Fim da data de ocorrência do evento. |
Exemplo
Requisição:
curl -i \ -H "Authorization: Bearer $BOLETOSIMPLES_TOKEN" \ -H 'Content-Type: application/json' \ -H 'User-Agent: MyApp (myapp@example.com)' \ -X GET "https://api-sandbox.kobana.com.br/v1/events?page=1&per_page=2"Resposta:
HTTP/1.1 200 OK Date: Fri, 17 Oct 2014 19:46:16 GMT Status: 200 OK Link: <https://api-sandbox.kobana.com.br/v1/events?page=2&per_page=2>; rel="last", <https://api-sandbox.kobana.com.br/v1/events?page=2&per_page=2>; rel="next" Total: 4 Content-Type: application/json; charset=utf-8 ... [ { "id": 224, "code": "customer.updated", "bank_billet_account_id": null, "resource_owner_id":67, "data": { "object": { "id": 67, "city_name": "Rio de Janeiro", "person_name": "Joao da Silva", "address": "Rua quinhentos", "address_complement": "Sala 4", "address_number": "111", "mobile_number": "", "cnpj_cpf": "782.661.177-64", "email": "novo@example.com", "neighborhood": "bairro", "person_type": "individual", "phone_number": "2112123434", "zipcode": "12312-123", "mobile_local_code": "", "state": "RJ", "created_via_api": true }, "changes": { "email": [ "antigo@example.com", "novo@example.com" ], "mobile_local_code": [ null, "" ], "mobile_number": [ null, "" ], "updated_at": [ "2015-03-08 19:27:36 -0300", "2015-03-17 21:37:53 -0300" ] } }, "occurred_at": "2015-03-17T21:37:53.000-03:00" }, { "id": 223, "code": "transaction.created", "bank_billet_account_id": null, "resource_owner_id":68, "data": { "object": { "id": 68, "amount": -5, "created_at": "2015-03-17", "description": "Boleto Banc\u00e1rio 862", "kind": "fee", "processed_at": null, "sent_at": null, "status": "unprocessed", "credit_at": "2015-03-26" } }, "occurred_at": "2015-03-17T21:37:27.000-03:00" } ]