Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created June 29, 2017 11:20
Show Gist options
  • Save eminetto/c8b2a6a8e726d36c202eaae41eef8d73 to your computer and use it in GitHub Desktop.
Save eminetto/c8b2a6a8e726d36c202eaae41eef8d73 to your computer and use it in GitHub Desktop.
API Blueprint
FORMAT: 1A
HOST: http://api.sample.com.br/v1
# Sample da API
Descrição da Sample.
# Group API
## Sobre [/]
Aqui podemos descrever detalhes que são comuns a todos os serviços como formatos, headers, tipos de erros, etc
# Group Mensagem
## Mensagens [/message]
### Criar mensagens [POST]
+ Request Criar uma mensagem
+ Headers
Accept: application/json
Content-Type: application/json
+ Attributes (Message)
+ Response 201 (application/json)
+ Attributes (Created)
### Listar mensagens [GET]
+ Response 200 (application/json)
+ Attributes (array[Message])
+ Response 404 (application/json)
+ Attributes (Error)
## Mensagem [/message/{id_message}]
+ Parameters
+ id_message: 1 (number, required) - ID da mensagem
### Ver mensagem [GET]
+ Response 200 (application/json)
+ Attributes (Message)
+ Response 404 (application/json)
+ Attributes (Error)
### Excluir mensagem [DELETE]
+ Response 200 (application/json)
+ Attributes (Id)
+ Response 404 (application/json)
+ Attributes (Error)
### Alterar mensagem [POST]
+ Request Alterar uma mensagem
+ Headers
Accept: application/json
Content-Type: application/json
+ Attributes (Message)
+ Response 200 (application/json)
+ Attributes (Created)
+ Response 400 (application/json)
+ Attributes (Error)
## Anexos [/message/{id_message}/file]
+ Parameters
+ id_message: 1 (number) - ID da mensagem
### Listar anexos [GET]
+ Response 200 (application/json)
+ Attributes (array[File])
+ Response 404 (application/json)
+ Attributes (Error)
## Anexos [/message/{id_message}/file/{file_id}]
+ Parameters
+ id_message: 1 (number) - ID da mensagem
+ file_id: 1 (number) - ID do arquivo
### Ver anexo [GET]
+ Response 200 (application/json)
+ Attributes (File)
+ Response 404 (application/json)
+ Attributes (Error)
### Remover anexo [DELETE]
+ Response 200 (application/json)
+ Attributes (Id)
+ Response 400 (application/json)
+ Attributes (Error)
# Data Structures
## Message (object)
+ subject (string) - Assunto da mensagem
+ body (string) - Corpo da mensagem
## MessageUpdate (Message)
+ id_message (number) - Id da mensagem
## File (object)
+ id_file (number) - Id do arquivo
+ name (string) - Nome do arquivo
+ url (string) - Url do arquivo
## Created (object)
+ id (number) - Id gerado
## Id (object)
+ id (number) - Id a ser processado
## Error (object)
+ code: 400 (number) - Status code
+ message (string) - Mensagem do status
+ description (string) - Descrição do status
## Multi (object)
+ id (number) - Código da entidade
+ code: 200 (number) - Status code
+ message (string) - Descrição do status
## User (object)
+ id (number) - Código do usuário
+ name (string) - Nome do usuário
+ token (string) - Token do usuário conectado
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment