API do Monde “beta”

Seja bem-vindo a documentaço da API do Monde! Se você quer desenvolver alguma integração com o Monde, está no lugar certo. Nossa API é bem recente e ainda dá acesso a poucas partes do sistema, mas pretendemos ir expandindo ela priorizando a necessidade dos clientes.

Apesar da simplicidade atual da API, ela já é usada dentro da Monde por todos os nossos aplicativos, principalmente para iOS e Android, mas também por nosso aplicativo Windows, portanto fique tranquilo que a API é uma iniciativa bem séria pra gente e trabalhamos duro para mantê-la o mais estável possível.

Como ainda estamos em fase beta, a documentação está menos detalhada do que gostaríamos, portanto se tiver dúvidas ou precisar de qualquer ajuda, estamos a disposição para auxiliar pelo nosso canal de suporte.

Sobre a API Versão 2

A API segue 100% a especificação JSON:API. Algumas informações rápidas para facilitar:

  • Todas as requisições devem ser feitas para https://web.monde.com.br/api/v2
  • Atualmente a autenticação é realizada por token (JWT), seguindo a RFC 7591.
  • Toda requisição deve ser HTTPS e ter Content-Type: application/vnd.api+json adicionado ao Header.

Fazendo uma requisição

O processo se dá em dois passos: Autenticação e Requisição. Sendo que a Autenticação não precisa ser realizada todo momento, e pode ser realizado apenas quando o token expirar(a cada 1 hora).

Passo 1 - Autenticação:

Faça a autenticação de acordo como descrito em: Criar Token de Acesso

PS: Tome nota do seu token de acesso

Passo 2 - Requisição:

Para fazer uma requisição siga a documentação como no exemplo: Buscar todos os cadastros

Erros e Códigos de resposta HTTP

Para análise dos erros da API veja o código de resposta HTTP, abaixo alguns códigos mais comuns e possíveis soluções:

  • 200: Tudo está correto.
  • 201: Registro criado com sucesso
  • 301: Redirecionamento (veja se o caminho está correto ou analise a documentação para saber se o seu endpoint não foi alterado)
  • 401: Não autorizado (seu usuário ou senha estão errados ou seu token pode ter expirado)
  • 403: Não permitida essa ação
  • 404: Não encontrado (possivelmente você errou o endpoint, ou algum header do endpoit, ou o registro no eciste)
  • 422: Erro na validação dos dados
  • 500: Algum problema pode estar acontecendo nos nossos servidores, nos avise que tentaremos resolver o mais rápido possível.

Cidades

Acesso somente com Autenticação

Retorna um erro de autenticação caso o token seja incorreto ou não informado.

Endpoint

GET api/v2/cities

Request

Route

GET api/v2/cities

Headers

Authorization: Bearer token-invalido
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/cities" -X GET \
	-H "Authorization: Bearer token-invalido" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

401

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Erro de autenticação",
      "detail": "O token de autenticação fornecido está expirado ou é inválido",
      "code": "401",
      "status": "401"
    }
  ]
}

Buscar todos os cadastros

Retorna todos os cadastros, páginados em 50 registros

Endpoint

GET api/v2/cities

Request

Route

GET api/v2/cities

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI4YzI4YzMzOS1mYjM1LTQ5MDgtOWQ1ZC0zYzEwMDY1NGYzMjEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzd9.4RvGlk-mlFiGyAc9xuO9chkWS2kJsRItBRN4aUF8tPc
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/cities" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI4YzI4YzMzOS1mYjM1LTQ5MDgtOWQ1ZC0zYzEwMDY1NGYzMjEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzd9.4RvGlk-mlFiGyAc9xuO9chkWS2kJsRItBRN4aUF8tPc" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "6315bcd9-c1f3-467b-98c7-abed6e678c62",
      "type": "cities",
      "links": {
        "self": "http://web.monde.com.br/api/v2/cities/6315bcd9-c1f3-467b-98c7-abed6e678c62"
      },
      "attributes": {
        "name": "Americana"
      },
      "relationships": {
        "people": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/cities/6315bcd9-c1f3-467b-98c7-abed6e678c62/relationships/people",
            "related": "http://web.monde.com.br/api/v2/cities/6315bcd9-c1f3-467b-98c7-abed6e678c62/people"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/cities?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/cities?page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar cadastros

Filtra os cadastros por nome

Endpoint

GET api/v2/cities?filter[search]=:search

Parameters

Name Description
filter[search] Filtra cadastros de cidades. Suporta pesquisa pelo nome.

Request

Route

GET api/v2/cities?filter[search]=Amer

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI3ZGY0MjEyZi1iNzYyLTRhODEtOWZkYy1hM2NjMDg0MTJlZjEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTk3Mzk4ODN9.1g7kn21Vqsw9aEo-ERlzVw20A1Njy5AmcSjUpplBfo8
Content-Type: application/vnd.api+json

Query Parameters

filter={"search"=>"Amer"}

Curl

curl -g "https://web.monde.com.br/api/v2/cities?filter[search]=Amer" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI3ZGY0MjEyZi1iNzYyLTRhODEtOWZkYy1hM2NjMDg0MTJlZjEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTk3Mzk4ODN9.1g7kn21Vqsw9aEo-ERlzVw20A1Njy5AmcSjUpplBfo8" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "053b4acc-da45-44e5-b409-9cd1666ce7d2",
      "type": "cities",
      "links": {
        "self": "http://web.monde.com.br/api/v2/cities/053b4acc-da45-44e5-b409-9cd1666ce7d2"
      },
      "attributes": {
        "name": "Americana"
      },
      "relationships": {
        "people": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/cities/053b4acc-da45-44e5-b409-9cd1666ce7d2/relationships/people",
            "related": "http://web.monde.com.br/api/v2/cities/053b4acc-da45-44e5-b409-9cd1666ce7d2/people"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/cities?filter%5Bsearch%5D=Amer&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/cities?filter%5Bsearch%5D=Amer&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Buscar pelo identificador

Busca um cadastro através do seu código identificador(id)

Endpoint

GET api/v2/cities/:id

Parameters

Name Description
id Required Código identificador do cadastro

Request

Route

GET api/v2/cities/1857afc5-39dc-42d6-a8b9-10538efc1e7e

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJmYzBhM2Q2NS01ODUzLTQ0NTctYWM0Mi03NTU4ZDUyNjM3OTIiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzh9.tbaXLyKBxciFajfD80ZZY7ylzW30l9cyC_0iozx_Ppo
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/cities/1857afc5-39dc-42d6-a8b9-10538efc1e7e" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJmYzBhM2Q2NS01ODUzLTQ0NTctYWM0Mi03NTU4ZDUyNjM3OTIiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzh9.tbaXLyKBxciFajfD80ZZY7ylzW30l9cyC_0iozx_Ppo" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "1857afc5-39dc-42d6-a8b9-10538efc1e7e",
    "type": "cities",
    "links": {
      "self": "http://web.monde.com.br/api/v2/cities/1857afc5-39dc-42d6-a8b9-10538efc1e7e"
    },
    "attributes": {
      "name": "Americana"
    },
    "relationships": {
      "people": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/cities/1857afc5-39dc-42d6-a8b9-10538efc1e7e/relationships/people",
          "related": "http://web.monde.com.br/api/v2/cities/1857afc5-39dc-42d6-a8b9-10538efc1e7e/people"
        }
      }
    }
  }
}

Formato de Erros

Exemplifica o formato e mensagens comuns de erros

Autenticação

Retorna um erro de autenticação caso o token seja incorreto ou não informado.

Endpoint

GET api/v2/people

Request

Route

GET api/v2/people

Headers

Authorization: Bearer token-invalido
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/people" -X GET \
	-H "Authorization: Bearer token-invalido" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

401

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Erro de autenticação",
      "detail": "O token de autenticação fornecido está expirado ou é inválido",
      "code": "401",
      "status": "401"
    }
  ]
}

Validação

Endpoint

POST api/v2/people

Parameters

Name Description
type Required Tipo do recurso e deve ser sempre <code>people</code>.
attributes[name] Required Nome completo da pessoa.
attributes[kind] Required Tipo da pessoa: J - Pessoa Juridica, F - Pessao Física.

Request

Route

POST api/v2/people

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjZjJiMTJkYy02OTA2LTRkNjktOTRlYy00NzJhZTVlZWFhZTEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzExNjk5Nzh9.NZRTbDqNyHCLK4dcn74lfSVVPcDa57BzHuwsAAD357E
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "people"
  }
}

Curl

curl "https://web.monde.com.br/api/v2/people" -d '{"data":{"type":"people"}}' -X POST \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjZjJiMTJkYy02OTA2LTRkNjktOTRlYy00NzJhZTVlZWFhZTEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzExNjk5Nzh9.NZRTbDqNyHCLK4dcn74lfSVVPcDa57BzHuwsAAD357E" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

422

Headers

Content-Type: application/vnd.api+json

Body

{
  "errors": [
    {
      "title": "não possui o tamanho esperado (1 caracteres)",
      "detail": "kind - não possui o tamanho esperado (1 caracteres)",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/kind"
      },
      "status": "422"
    },
    {
      "title": "não pode ficar em branco",
      "detail": "kind - não pode ficar em branco",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/kind"
      },
      "status": "422"
    },
    {
      "title": "não pode ficar em branco",
      "detail": "name - não pode ficar em branco",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}

Formação do corpo do resource

Endpoint

POST api/v2/people

Parameters

Name Description
type Required Tipo do recurso e deve ser sempre <code>people</code>.
attributes[name] Required Nome completo da pessoa.
attributes[city] Required Campo informado de forma incorreta (a forma correta é pelo campo de relacionamento).

Request

Route

POST api/v2/people

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIzZmM2ZWQzZi1jMDZlLTQyNzktODBjOS0yNWRmYjEwNTViMzkiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzExNjk5Nzh9.51qRUtKnEOFPwCDZRdhxJTjHuzEshPZ-Cm4pZLS4KgA
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "people",
    "attributes": {
      "name": "John Doe",
      "city": "Americana"
    }
  }
}

Curl

curl "https://web.monde.com.br/api/v2/people" -d '{"data":{"type":"people","attributes":{"name":"John Doe","city":"Americana"}}}' -X POST \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIzZmM2ZWQzZi1jMDZlLTQyNzktODBjOS0yNWRmYjEwNTViMzkiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzExNjk5Nzh9.51qRUtKnEOFPwCDZRdhxJTjHuzEshPZ-Cm4pZLS4KgA" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

400

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Corpo da requisição inválido",
      "detail": "Verifique o corpo da requisição, a estrutura do corpo ou a forma que algum campo foi declarado, pode estar incorreto",
      "code": "100",
      "status": "400"
    }
  ]
}

Falta de permissão

Valida as permissões para editar um cadastro de pessoa.

Certos procedimentos requerem que o usuário seja administrador.

Endpoint

PATCH api/v2/people/:_id

Parameters

Name Description
type Required Tipo do recurso e deve ser sempre <code>people</code>.
id Required ID da pessoa a ser alterada.

Request

Route

PATCH api/v2/people/3ee76e99-662d-4c58-84e8-da4bb979d7dd

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJmZjBiOTMxNy1mMDVkLTRiYWItOWEyOS01Y2VkNWMxZWVkNDMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzExNjk5Nzh9.pYVg6x49PSprUt0GLmf5QHzxGTs6qYPRx-j4r8Jqrbw
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "people",
    "id": "3ee76e99-662d-4c58-84e8-da4bb979d7dd"
  }
}

Curl

curl "https://web.monde.com.br/api/v2/people/3ee76e99-662d-4c58-84e8-da4bb979d7dd" -d '{"data":{"type":"people","id":"3ee76e99-662d-4c58-84e8-da4bb979d7dd"}}' -X PATCH \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJmZjBiOTMxNy1mMDVkLTRiYWItOWEyOS01Y2VkNWMxZWVkNDMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzExNjk5Nzh9.pYVg6x49PSprUt0GLmf5QHzxGTs6qYPRx-j4r8Jqrbw" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

403

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Sem permissão",
      "detail": "Sem permissão de acesso para essa operação",
      "code": "403",
      "status": "403"
    }
  ]
}

Recurso incorreto

Endpoint

PATCH api/v2/wrong_resource

Request

Route

PATCH api/v2/wrong_resource

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI0NTUxMjIyNy1lYjgxLTQzZTktOTQwNi1iZWE2Nzg3YWFmYjQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzE3NjY5NzN9.nm4hriAMT2t6zRzD1oFz2_sJt8eObrG2lMG5-S-BAVc
Content-Type: application/vnd.api+json

Curl

curl "https://web.monde.com.br/api/v2/wrong_resource" -d '' -X PATCH \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI0NTUxMjIyNy1lYjgxLTQzZTktOTQwNi1iZWE2Nzg3YWFmYjQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzE3NjY5NzN9.nm4hriAMT2t6zRzD1oFz2_sJt8eObrG2lMG5-S-BAVc" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

404

Headers

Content-Type: application/vnd.api+json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Recurso não encontrado",
      "detail": "Recurso informado não encontrado",
      "code": "404",
      "status": "404"
    }
  ]
}

Registro com vínculo

Endpoint

DELETE api/v2/people/:id

Parameters

Name Description
id Required ID da pessoa a ser excluída.

Request

Route

DELETE api/v2/people/e6ce8586-0663-402e-81df-ba89adfcac77

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlNmNlODU4Ni0wNjYzLTQwMmUtODFkZi1iYTg5YWRmY2FjNzciLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzExNjk5Nzh9.pDNxt04EibT8y8dThZqu45VY5khZYKHOGJyYN_x-88A
Content-Type: application/vnd.api+json

Curl

curl "https://web.monde.com.br/api/v2/people/e6ce8586-0663-402e-81df-ba89adfcac77" -d '' -X DELETE \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlNmNlODU4Ni0wNjYzLTQwMmUtODFkZi1iYTg5YWRmY2FjNzciLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MzExNjk5Nzh9.pDNxt04EibT8y8dThZqu45VY5khZYKHOGJyYN_x-88A" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

422

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Registro relacionado",
      "detail": "Esse registro não pode ser excluído pois possui registros relacionados",
      "code": "100",
      "status": "422"
    }
  ]
}

Pessoas

Gerencia os cadastros de pessoas

Acesso somente com autenticação

Retorna um erro de autenticação caso o token seja incorreto ou não informado.

Endpoint

GET api/v2/people

Request

Route

GET api/v2/people

Headers

Authorization: Bearer token-invalido
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/people" -X GET \
	-H "Authorization: Bearer token-invalido" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

401

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Erro de autenticação",
      "detail": "O token de autenticação fornecido está expirado ou é inválido",
      "code": "401",
      "status": "401"
    }
  ]
}

Buscar todos os cadastros

Retorna todos os cadastros, páginados em 50 registros

Endpoint

GET api/v2/people

Parameters

Name Description
page[number] Número da página
page[size] Número de registros por página

Request

Route

GET api/v2/people

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIzMzlmYWFiMS01ZTI3LTQxNjUtYmRiNS1hZGM3ZTk2MDAzMmQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.BIpgJoyD87hXa-IJP8e1uDFf3yo3b4YOYs7zuJ4tc2c
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/people" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIzMzlmYWFiMS01ZTI3LTQxNjUtYmRiNS1hZGM3ZTk2MDAzMmQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.BIpgJoyD87hXa-IJP8e1uDFf3yo3b4YOYs7zuJ4tc2c" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Response Fields

Name Description
data[id] Código identificador
data[type] Identifica o tipo do recurso
data[links][self] Endereço do recurso
data[attributes][name] Nome da pessoa
data[attributes][company-name] Razão social
data[attributes][address] Endereço
data[attributes][number] Número do endereço
data[attributes][complement] Complemento do endereço
data[attributes][district] Bairro
data[attributes][zip] CEP
data[attributes][birth-date] Data de nascimento
data[attributes][cpf] CPF
data[attributes][rg] RG
data[attributes][passport-number] Número do passaporte
data[attributes][passport-expiration] Data de validade do passaporte
data[attributes][gender] Sexo
data[attributes][business-phone] Telefone comercial
data[attributes][mobile-phone] Telefone celular
data[attributes][cnpj] CNPJ
data[attributes][state-inscription] Inscrição estadual
data[attributes][city-inscription] Inscrição municipal
data[attributes][phone] Telefone
data[attributes][email] E-mail
data[attributes][website] Web Site
data[attributes][observations] Observações
data[attributes][registered-at] Data de registro
data[attributes][kind] Tipo do cadastro: J - Pessoa Juridica, F - Pessoa Fisica
data[attributes][code] Código númerico atribuído ao cadastro
data[relationships][city] Links para buscar os dados da cidade
data[relationships][creator] Links para buscar os dados do usuário criador do cadastro
links[first] Primeira página de dados
links[prev] Página anterior
links[next] Próxima página de dados
links[last] Última página de dados

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "339faab1-5e27-4165-bdb5-adc7e960032d",
      "type": "people",
      "links": {
        "self": "http://web.monde.com.br/api/v2/people/339faab1-5e27-4165-bdb5-adc7e960032d"
      },
      "attributes": {
        "name": "Company One",
        "company-name": "Company One",
        "address": "1st Street",
        "number": "899",
        "complement": "Casa",
        "district": "St. John",
        "zip": "89999000",
        "birth-date": "2010-04-05",
        "cpf": "88458546558",
        "rg": "1234456",
        "passport-number": null,
        "passport-expiration": null,
        "gender": null,
        "cnpj": null,
        "city-inscription": "1234567890",
        "state-inscription": "1234567890",
        "observations": "nothing to note",
        "registered-at": "2018-06-20T18:07:22.166-03:00",
        "business-phone": null,
        "mobile-phone": null,
        "phone": "4991782812",
        "email": "carleton@fishertillman.net",
        "website": "https://www.site.com.br",
        "code": 11,
        "kind": "F"
      },
      "relationships": {
        "city": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/people/339faab1-5e27-4165-bdb5-adc7e960032d/relationships/city",
            "related": "http://web.monde.com.br/api/v2/people/339faab1-5e27-4165-bdb5-adc7e960032d/city"
          }
        },
        "creator": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/people/339faab1-5e27-4165-bdb5-adc7e960032d/relationships/creator",
            "related": "http://web.monde.com.br/api/v2/people/339faab1-5e27-4165-bdb5-adc7e960032d/creator"
          }
        }
      }
    },
    {
      "id": "35bc59b0-20ce-4290-9804-ead0c0fd5d28",
      "type": "people",
      "links": {
        "self": "http://web.monde.com.br/api/v2/people/35bc59b0-20ce-4290-9804-ead0c0fd5d28"
      },
      "attributes": {
        "name": "Company One",
        "company-name": "Company One",
        "address": "1st Street",
        "number": "899",
        "complement": "Casa",
        "district": "St. John",
        "zip": "89999000",
        "birth-date": "2010-04-05",
        "cpf": null,
        "rg": null,
        "passport-number": null,
        "passport-expiration": null,
        "gender": null,
        "cnpj": "82399677499669",
        "city-inscription": "1234567890",
        "state-inscription": "1234567890",
        "observations": "nothing to note",
        "registered-at": "2018-06-20T18:07:22.213-03:00",
        "business-phone": "49368990000",
        "mobile-phone": "4991782812",
        "phone": null,
        "email": "kirsten.miller@ruelmurray.org",
        "website": "https://www.site.com.br",
        "code": 12,
        "kind": "J"
      },
      "relationships": {
        "city": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/people/35bc59b0-20ce-4290-9804-ead0c0fd5d28/relationships/city",
            "related": "http://web.monde.com.br/api/v2/people/35bc59b0-20ce-4290-9804-ead0c0fd5d28/city"
          }
        },
        "creator": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/people/35bc59b0-20ce-4290-9804-ead0c0fd5d28/relationships/creator",
            "related": "http://web.monde.com.br/api/v2/people/35bc59b0-20ce-4290-9804-ead0c0fd5d28/creator"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/people?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/people?page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar cadastros

Filtra os cadastros por nome, razão social, cpf ou cnpj

Endpoint

GET api/v2/people?filter[search]=:search

Parameters

Name Description
filter[search] Filtra cadastros de pessoas. Suporta pesquisa pelo nome, razão social, cpf e cnpj.

Request

Route

GET api/v2/people?filter[search]=CVC

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YTUxNWJjMC03NGRkLTRkYTAtOTgxMi1hNzJiMDQ4ZDRiNmYiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.Z5jLZJyQh4_7CuDNCahLBz_08cXWdLJ5VNfPX_OWV3I
Content-Type: application/vnd.api+json

Query Parameters

filter={"search"=>"CVC"}

Curl

curl -g "https://web.monde.com.br/api/v2/people?filter[search]=CVC" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YTUxNWJjMC03NGRkLTRkYTAtOTgxMi1hNzJiMDQ4ZDRiNmYiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.Z5jLZJyQh4_7CuDNCahLBz_08cXWdLJ5VNfPX_OWV3I" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "d424047c-c00a-46fe-a0cc-d222c4708a07",
      "type": "people",
      "links": {
        "self": "http://web.monde.com.br/api/v2/people/d424047c-c00a-46fe-a0cc-d222c4708a07"
      },
      "attributes": {
        "name": "Company One",
        "company-name": "CVC",
        "address": "1st Street",
        "number": "899",
        "complement": "Casa",
        "district": "St. John",
        "zip": "89999000",
        "birth-date": "2010-04-05",
        "cpf": null,
        "rg": null,
        "passport-number": null,
        "passport-expiration": null,
        "gender": null,
        "cnpj": "41314369356848",
        "city-inscription": "1234567890",
        "state-inscription": "1234567890",
        "observations": "nothing to note",
        "registered-at": "2018-06-20T18:07:22.444-03:00",
        "business-phone": "49368990000",
        "mobile-phone": "4991782812",
        "phone": null,
        "email": "cletus@altenwerth.net",
        "website": "https://www.site.com.br",
        "code": 15,
        "kind": "J"
      },
      "relationships": {
        "city": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/people/d424047c-c00a-46fe-a0cc-d222c4708a07/relationships/city",
            "related": "http://web.monde.com.br/api/v2/people/d424047c-c00a-46fe-a0cc-d222c4708a07/city"
          }
        },
        "creator": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/people/d424047c-c00a-46fe-a0cc-d222c4708a07/relationships/creator",
            "related": "http://web.monde.com.br/api/v2/people/d424047c-c00a-46fe-a0cc-d222c4708a07/creator"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/people?filter%5Bsearch%5D=CVC&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/people?filter%5Bsearch%5D=CVC&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar pessoas que são usuários

Filtra os cadastros de pessoas que são usuários do sistema

Endpoint

GET api/v2/people?filter[only_users]=:only_users

Parameters

Name Description
filter[only_users] Quando passado o valor 'true', busca somente pessoas que são usuários do sistema

Request

Route

GET api/v2/people?filter[only_users]=true

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJkZjJmYTE5MC00Mjg4LTQ4YTItYjliNC1lMDgwNjkyY2QzYzciLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.Vg4nSfcRredjaWAcW-lqr_NS_ipX-PGIhkFeG2i41I8
Content-Type: application/vnd.api+json

Query Parameters

filter={"only_users"=>"true"}

Curl

curl -g "https://web.monde.com.br/api/v2/people?filter[only_users]=true" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJkZjJmYTE5MC00Mjg4LTQ4YTItYjliNC1lMDgwNjkyY2QzYzciLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.Vg4nSfcRredjaWAcW-lqr_NS_ipX-PGIhkFeG2i41I8" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "df2fa190-4288-48a2-b9b4-e080692cd3c7",
      "type": "people",
      "links": {
        "self": "http://web.monde.com.br/api/v2/people/df2fa190-4288-48a2-b9b4-e080692cd3c7"
      },
      "attributes": {
        "name": "Company One",
        "company-name": "Company One",
        "address": "1st Street",
        "number": "899",
        "complement": "Casa",
        "district": "St. John",
        "zip": "89999000",
        "birth-date": "2010-04-05",
        "cpf": "33244584209",
        "rg": "1234456",
        "passport-number": null,
        "passport-expiration": null,
        "gender": null,
        "cnpj": null,
        "city-inscription": "1234567890",
        "state-inscription": "1234567890",
        "observations": "nothing to note",
        "registered-at": "2018-06-20T18:07:22.504-03:00",
        "business-phone": null,
        "mobile-phone": null,
        "phone": "4991782812",
        "email": "shad@bruenmarquardt.info",
        "website": "https://www.site.com.br",
        "code": 16,
        "kind": "F"
      },
      "relationships": {
        "city": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/people/df2fa190-4288-48a2-b9b4-e080692cd3c7/relationships/city",
            "related": "http://web.monde.com.br/api/v2/people/df2fa190-4288-48a2-b9b4-e080692cd3c7/city"
          }
        },
        "creator": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/people/df2fa190-4288-48a2-b9b4-e080692cd3c7/relationships/creator",
            "related": "http://web.monde.com.br/api/v2/people/df2fa190-4288-48a2-b9b4-e080692cd3c7/creator"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/people?filter%5Bonly_users%5D=true&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/people?filter%5Bonly_users%5D=true&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Buscar pelo identificador

Busca um cadastro através do seu código identificador(id)

Endpoint

GET api/v2/people/:id

Parameters

Name Description
id Required Código identificador do cadastro

Request

Route

GET api/v2/people/13052c29-c6ee-4c9d-9664-d0902e4e1b32

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxMzA1MmMyOS1jNmVlLTRjOWQtOTY2NC1kMDkwMmU0ZTFiMzIiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.aF-qIgUImtEx1aLZU3knfAztWFLHfP33BMYlDtOarI4
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/people/13052c29-c6ee-4c9d-9664-d0902e4e1b32" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxMzA1MmMyOS1jNmVlLTRjOWQtOTY2NC1kMDkwMmU0ZTFiMzIiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.aF-qIgUImtEx1aLZU3knfAztWFLHfP33BMYlDtOarI4" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "13052c29-c6ee-4c9d-9664-d0902e4e1b32",
    "type": "people",
    "links": {
      "self": "http://web.monde.com.br/api/v2/people/13052c29-c6ee-4c9d-9664-d0902e4e1b32"
    },
    "attributes": {
      "name": "Company One",
      "company-name": "Company One",
      "address": "1st Street",
      "number": "899",
      "complement": "Casa",
      "district": "St. John",
      "zip": "89999000",
      "birth-date": "2010-04-05",
      "cpf": "25298118305",
      "rg": "1234456",
      "passport-number": null,
      "passport-expiration": null,
      "gender": null,
      "cnpj": null,
      "city-inscription": "1234567890",
      "state-inscription": "1234567890",
      "observations": "nothing to note",
      "registered-at": "2018-06-20T18:07:22.635-03:00",
      "business-phone": null,
      "mobile-phone": null,
      "phone": "4991782812",
      "email": "jaydon_hartmann@cummingsbernier.com",
      "website": "https://www.site.com.br",
      "code": 18,
      "kind": "F"
    },
    "relationships": {
      "city": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/people/13052c29-c6ee-4c9d-9664-d0902e4e1b32/relationships/city",
          "related": "http://web.monde.com.br/api/v2/people/13052c29-c6ee-4c9d-9664-d0902e4e1b32/city"
        }
      },
      "creator": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/people/13052c29-c6ee-4c9d-9664-d0902e4e1b32/relationships/creator",
          "related": "http://web.monde.com.br/api/v2/people/13052c29-c6ee-4c9d-9664-d0902e4e1b32/creator"
        }
      }
    }
  }
}

Cadastrar uma pessoa

Endpoint

POST api/v2/people

Parameters

Name Description
type Required Tipo do recurso e deve ser sempre <code>people</code>.
attributes[name] Required Nome completo da pessoa.
attributes[company-name] Razão social.
attributes[address] Endereço
attributes[number] Número do endereço
attributes[complement] Complemento do endereço
attributes[district] Bairro
attributes[zip] CEP
attributes[birth-date] Data de nascimento
attributes[cpf] Documento de identificação da pessoa CPF(Fisica).
attributes[cnpj] Documento de identificação da pessoa CNPJ(Jurídica).
attributes[rg] Carteira de identidade
attributes[passport-number] Número do passaporte
attributes[passport-expiration] Data de validade do passaporte
attributes[gender] Sexo
attributes[business-phone] Telefone comercial
attributes[mobile-phone] Telefone celular
attributes[state-inscription] Inscrição estadual
attributes[city-inscription] Inscrição municipal
attributes[phone] Telefone de contato do pessoa.
attributes[email] E-mail de contato.
attributes[website] Web site
attributes[observations] Observações
attributes[kind] Required Tipo da pessoa: J - Pessoa Juridica, F - Pessao Física.
relationships[city] Cidade em que reside.

Request

Route

POST api/v2/people

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI5ZmZiNGU3YS1hY2I4LTQxMDUtYjZkNS0xZDg3Y2M2MjkyNzAiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.OoXEKOvI_TZD_HlPxuhmyKPAEm287-Xen9o5jAHfkM4
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "people",
    "attributes": {
      "name": "John Dohn",
      "company-name": "Company One",
      "address": "1st street",
      "number": "number",
      "complement": "Casa",
      "district": "St. John Island",
      "zip": "89123-000",
      "birth-date": "2008-06-20T18:07:22.819-03:00",
      "cpf": "98126933941",
      "cnpj": "",
      "rg": "3.890.345",
      "passport-number": "",
      "passport-expiration": "",
      "gender": "",
      "business-phone": "",
      "mobile-phone": "",
      "state-inscription": "",
      "city-inscription": "",
      "phone": "+55 49 91342211",
      "email": "john.dohn@mail.com",
      "website": "http://www.mysite.com.br",
      "observations": "",
      "kind": "F"
    },
    "relationships": {
      "city": {
        "data": {
          "id": "9dde49eb-54f7-466a-8763-3eb2d720e7e3",
          "type": "cities"
        }
      }
    }
  }
}

Curl

curl "https://web.monde.com.br/api/v2/people" -d '{"data":{"type":"people","attributes":{"name":"John Dohn","company-name":"Company One","address":"1st street","number":"number","complement":"Casa","district":"St. John Island","zip":"89123-000","birth-date":"2008-06-20T18:07:22.819-03:00","cpf":"98126933941","cnpj":"","rg":"3.890.345","passport-number":"","passport-expiration":"","gender":"","business-phone":"","mobile-phone":"","state-inscription":"","city-inscription":"","phone":"+55 49 91342211","email":"john.dohn@mail.com","website":"http://www.mysite.com.br","observations":"","kind":"F"},"relationships":{"city":{"data":{"id":"9dde49eb-54f7-466a-8763-3eb2d720e7e3","type":"cities"}}}}}' -X POST \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI5ZmZiNGU3YS1hY2I4LTQxMDUtYjZkNS0xZDg3Y2M2MjkyNzAiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1Mjk1MzI0NDJ9.OoXEKOvI_TZD_HlPxuhmyKPAEm287-Xen9o5jAHfkM4" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

201

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "f68189fe-21ad-48f6-b24f-e9b0591d519c",
    "type": "people",
    "links": {
      "self": "http://web.monde.com.br/api/v2/people/f68189fe-21ad-48f6-b24f-e9b0591d519c"
    },
    "attributes": {
      "name": "John Dohn",
      "company-name": "Company One",
      "address": "1st street",
      "number": "number",
      "complement": "Casa",
      "district": "St. John Island",
      "zip": "89123000",
      "birth-date": "2008-06-20",
      "cpf": "98126933941",
      "rg": "3.890.345",
      "passport-number": "",
      "passport-expiration": null,
      "gender": "",
      "cnpj": null,
      "city-inscription": "",
      "state-inscription": "",
      "observations": "",
      "registered-at": "2018-06-20T18:07:22.861-03:00",
      "business-phone": "",
      "mobile-phone": "",
      "phone": "+55 49 91342211",
      "email": "john.dohn@mail.com",
      "website": "http://www.mysite.com.br",
      "code": 22,
      "kind": "F"
    },
    "relationships": {
      "city": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/people/f68189fe-21ad-48f6-b24f-e9b0591d519c/relationships/city",
          "related": "http://web.monde.com.br/api/v2/people/f68189fe-21ad-48f6-b24f-e9b0591d519c/city"
        }
      },
      "creator": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/people/f68189fe-21ad-48f6-b24f-e9b0591d519c/relationships/creator",
          "related": "http://web.monde.com.br/api/v2/people/f68189fe-21ad-48f6-b24f-e9b0591d519c/creator"
        }
      }
    }
  }
}

Formato do erro de validação

Endpoint

POST api/v2/people

Parameters

Name Description
type Required Tipo do recurso e deve ser sempre <code>people</code>.
attributes[name] Required Nome completo da pessoa.
attributes[kind] Required Tipo da pessoa: J - Pessoa Juridica, F - Pessao Física.

Request

Route

POST api/v2/people

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJkZjQ0N2MzMy1iMmM0LTQ4MGEtOWU1YS02ZTYxMTExNDE2Y2EiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzh9.Iw_lFPehiQ94G4_xpuB7s54Y5FoK-I1p91f4vztlPgI
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "people"
  }
}

Curl

curl "https://web.monde.com.br/api/v2/people" -d '{"data":{"type":"people"}}' -X POST \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJkZjQ0N2MzMy1iMmM0LTQ4MGEtOWU1YS02ZTYxMTExNDE2Y2EiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzh9.Iw_lFPehiQ94G4_xpuB7s54Y5FoK-I1p91f4vztlPgI" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

422

Headers

Content-Type: application/vnd.api+json

Body

{
  "errors": [
    {
      "title": "não possui o tamanho esperado (1 caracteres)",
      "detail": "kind - não possui o tamanho esperado (1 caracteres)",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/kind"
      },
      "status": "422"
    },
    {
      "title": "não pode ficar em branco",
      "detail": "kind - não pode ficar em branco",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/kind"
      },
      "status": "422"
    },
    {
      "title": "não pode ficar em branco",
      "detail": "name - não pode ficar em branco",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/name"
      },
      "status": "422"
    }
  ]
}

Editar um cadastro

Endpoint

PATCH api/v2/people/:_id

Parameters

Name Description
type Required Tipo do recurso e deve ser sempre <code>people</code>.
id Required ID da pessoa a ser alterada.
attributes[name] Required Nome completo da pessoa.

Request

Route

PATCH api/v2/people/e69b41d5-64f9-4cc7-b7d0-1fb0919681ae

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxZTg0ZmZmYy0wOWNhLTRhZTctODM0Ni1hMzJhYjRiMjgwNzciLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzh9.M-Oof7oCSxifgumdeEaRFPohRQt22I3Ds7gud-XrSRQ
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "people",
    "id": "e69b41d5-64f9-4cc7-b7d0-1fb0919681ae",
    "attributes": {
      "name": "John Dohn"
    }
  }
}

Curl

curl "https://web.monde.com.br/api/v2/people/e69b41d5-64f9-4cc7-b7d0-1fb0919681ae" -d '{"data":{"type":"people","id":"e69b41d5-64f9-4cc7-b7d0-1fb0919681ae","attributes":{"name":"John Dohn"}}}' -X PATCH \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxZTg0ZmZmYy0wOWNhLTRhZTctODM0Ni1hMzJhYjRiMjgwNzciLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzh9.M-Oof7oCSxifgumdeEaRFPohRQt22I3Ds7gud-XrSRQ" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "e69b41d5-64f9-4cc7-b7d0-1fb0919681ae",
    "type": "people",
    "links": {
      "self": "http://web.monde.com.br/api/v2/people/e69b41d5-64f9-4cc7-b7d0-1fb0919681ae"
    },
    "attributes": {
      "name": "John Dohn",
      "company-name": "Company One",
      "address": "1st Street",
      "number": "899",
      "complement": "Casa",
      "district": "St. John",
      "zip": "89999000",
      "birth-date": "2010-04-05",
      "cpf": "52764979746",
      "rg": "1234456",
      "passport-number": null,
      "passport-expiration": null,
      "gender": null,
      "business-phone": null,
      "home-phone": null,
      "mobile-phone": null,
      "cnpj": null,
      "state-inscription": "1234567890",
      "city-inscription": "1234567890",
      "phone": "4991782812",
      "fax": null,
      "email": "elliot.stanton@langworth.info",
      "website": "https://www.site.com.br",
      "observations": "nothing to note",
      "registered-at": "2017-11-06T16:17:58.697-02:00",
      "code": 25,
      "kind": "F"
    },
    "relationships": {
      "city": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/people/e69b41d5-64f9-4cc7-b7d0-1fb0919681ae/relationships/city",
          "related": "http://web.monde.com.br/api/v2/people/e69b41d5-64f9-4cc7-b7d0-1fb0919681ae/city"
        }
      },
      "creator": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/people/e69b41d5-64f9-4cc7-b7d0-1fb0919681ae/relationships/creator",
          "related": "http://web.monde.com.br/api/v2/people/e69b41d5-64f9-4cc7-b7d0-1fb0919681ae/creator"
        }
      }
    }
  }
}

Validar permissões para edição

Valida as permissões para editar um cadastro de pessoa.

Certos procedimentos requerem que o usuário seja administrador.

Endpoint

PATCH api/v2/people/:_id

Parameters

Name Description
type Required Tipo do recurso e deve ser sempre <code>people</code>.
id Required ID da pessoa a ser alterada.

Request

Route

PATCH api/v2/people/e9ee53a5-1e0a-4a66-8cc9-d5c49aa5fa63

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjZGVhMDhkMy1lMDE0LTQxNDItOWZmMS04OTRhYTMyYmM0ODAiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzB9.bwbsgDx2SBF0oCq0q_coVzQy1xaeDldW_2KOzB3DrxM
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "people",
    "id": "e9ee53a5-1e0a-4a66-8cc9-d5c49aa5fa63"
  }
}

Curl

curl "https://web.monde.com.br/api/v2/people/e9ee53a5-1e0a-4a66-8cc9-d5c49aa5fa63" -d '{"data":{"type":"people","id":"e9ee53a5-1e0a-4a66-8cc9-d5c49aa5fa63"}}' -X PATCH \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjZGVhMDhkMy1lMDE0LTQxNDItOWZmMS04OTRhYTMyYmM0ODAiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzB9.bwbsgDx2SBF0oCq0q_coVzQy1xaeDldW_2KOzB3DrxM" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

403

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Sem permissão",
      "detail": "Sem permissão de acesso para essa operação",
      "code": "403",
      "status": "403"
    }
  ]
}

Excluir a pessoa pelo ID

Endpoint

DELETE api/v2/people/:id

Parameters

Name Description
id Required ID da pessoa a ser excluída.

Request

Route

DELETE api/v2/people/65a406bd-dc5f-4a64-947b-340dd305a5a1

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJhMzEwZDQwMy1kOWU2LTQ2ZDgtYTRhMy1iNGM5YjliNzUzZGUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzh9.GCXUvaHC4cR879QsKViePoP8T-tCrs_lT9kPa4h-8KA
Content-Type: application/vnd.api+json

Curl

curl "https://web.monde.com.br/api/v2/people/65a406bd-dc5f-4a64-947b-340dd305a5a1" -d '' -X DELETE \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJhMzEwZDQwMy1kOWU2LTQ2ZDgtYTRhMy1iNGM5YjliNzUzZGUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzh9.GCXUvaHC4cR879QsKViePoP8T-tCrs_lT9kPa4h-8KA" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

204

Validar permissão para excluir

Endpoint

DELETE api/v2/people/:id

Parameters

Name Description
id Required ID da pessoa a ser excluída.

Request

Route

DELETE api/v2/people/6ab05ac3-cc31-4111-abea-f8c5fd44c1ba

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2NDgxYzJmYi05NzliLTQ5NTYtYmNjYy1jNWVkMTUwZGJkY2EiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzB9.Wcqo5r_iZI12KYWZg2_F40IwqUu27HEFwBUz3lFPKiw
Content-Type: application/vnd.api+json

Curl

curl "https://web.monde.com.br/api/v2/people/6ab05ac3-cc31-4111-abea-f8c5fd44c1ba" -d '' -X DELETE \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2NDgxYzJmYi05NzliLTQ5NTYtYmNjYy1jNWVkMTUwZGJkY2EiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzB9.Wcqo5r_iZI12KYWZg2_F40IwqUu27HEFwBUz3lFPKiw" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

403

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Sem permissão",
      "detail": "Sem permissão de acesso para essa operação",
      "code": "403",
      "status": "403"
    }
  ]
}

Alertar a exclusão de um cadastro com vínculo

Endpoint

DELETE api/v2/people/:id

Parameters

Name Description
id Required ID da pessoa a ser excluída.

Request

Route

DELETE api/v2/people/23ca4c19-c370-4efe-aabd-5ace5905d50a

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyM2NhNGMxOS1jMzcwLTRlZmUtYWFiZC01YWNlNTkwNWQ1MGEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA1MzU0NDh9.nLYjKkSuQ_4rKxTQoWZ-CiOs2JQGTenIjlK7SteHUWc
Content-Type: application/vnd.api+json

Curl

curl "https://web.monde.com.br/api/v2/people/23ca4c19-c370-4efe-aabd-5ace5905d50a" -d '' -X DELETE \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyM2NhNGMxOS1jMzcwLTRlZmUtYWFiZC01YWNlNTkwNWQ1MGEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA1MzU0NDh9.nLYjKkSuQ_4rKxTQoWZ-CiOs2JQGTenIjlK7SteHUWc" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

422

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Registro relacionado",
      "detail": "Esse registro não pode ser excluído pois possui registros relacionados",
      "code": "100",
      "status": "422"
    }
  ]
}

Categorias de Tarefas

Acesso somente com Autenticação

Retorna um erro de autenticação caso o token seja incorreto ou não informado.

Endpoint

GET api/v2/task-categories

Request

Route

GET api/v2/task-categories

Headers

Authorization: Bearer token-invalido
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/task-categories" -X GET \
	-H "Authorization: Bearer token-invalido" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

401

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Erro de autenticação",
      "detail": "O token de autenticação fornecido está expirado ou é inválido",
      "code": "100",
      "status": "401"
    }
  ]
}

Buscar todos os cadastros

Endpoint

GET api/v2/task-categories

Request

Route

GET api/v2/task-categories

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjMjViNDM1MC01Njg2LTRiNzktOWUyOS1jNGUzYWUwZjVkZTEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzl9.VYCE8HayIYMYuMrlo9wxhtQNfopmisLAcAb_qU9lzA0
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/task-categories" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjMjViNDM1MC01Njg2LTRiNzktOWUyOS1jNGUzYWUwZjVkZTEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzl9.VYCE8HayIYMYuMrlo9wxhtQNfopmisLAcAb_qU9lzA0" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "Geral",
      "type": "task-categories",
      "links": {
        "self": "http://web.monde.com.br/api/v2/task-categories/Geral"
      },
      "attributes": {
        "description": "Geral"
      },
      "relationships": {
        "tasks": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/task-categories/Geral/relationships/tasks",
            "related": "http://web.monde.com.br/api/v2/task-categories/Geral/tasks"
          }
        }
      }
    }
  ]
}

Buscar pelo identificador

Busca um cadastro através do seu código identificador(id)

Endpoint

GET api/v2/task-categories/:id

Parameters

Name Description
id Required Código identificador do cadastro

Request

Route

GET api/v2/task-categories/Geral

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI5NzA5M2E0My0zZTA3LTRlN2QtOWQ4Yy0xMDMzMTY0NzYwZTciLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzl9.kCZVn6OYv1k9GrsMyFuj9I1d-jzXpw2WCNmFP5k9t1g
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/task-categories/Geral" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI5NzA5M2E0My0zZTA3LTRlN2QtOWQ4Yy0xMDMzMTY0NzYwZTciLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MDk5OTU4Nzl9.kCZVn6OYv1k9GrsMyFuj9I1d-jzXpw2WCNmFP5k9t1g" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "Geral",
    "type": "task-categories",
    "links": {
      "self": "http://web.monde.com.br/api/v2/task-categories/Geral"
    },
    "attributes": {
      "description": "Geral"
    },
    "relationships": {
      "tasks": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/task-categories/Geral/relationships/tasks",
          "related": "http://web.monde.com.br/api/v2/task-categories/Geral/tasks"
        }
      }
    }
  }
}

Histórico de Tarefas

Gerencia os cadastros de históricos de tarefas

Acesso somente com autenticação

Retorna um erro de autenticação caso o token seja incorreto ou não informado.

Endpoint

GET api/v2/task-historics

Request

Route

GET api/v2/task-historics

Headers

Authorization: Bearer token-invalido
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/task-historics" -X GET \
	-H "Authorization: Bearer token-invalido" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

401

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Erro de autenticação",
      "detail": "O token de autenticação fornecido está expirado ou é inválido",
      "code": "401",
      "status": "401"
    }
  ]
}

Buscar todos os cadastros

Retorna todos os cadastros, páginados em 50 registros

Endpoint

GET api/v2/task-historics

Parameters

Name Description
page[number] Número da página
page[size] Número de registros por página

Request

Route

GET api/v2/task-historics

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxOTgzNWZiMy02NzgzLTQ5NzEtOTk3YS0xYmZjY2I4NjdiYzkiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.GHx4Wad7K7T1_KVFoGhhpdFQRnMjHZ9j7J8BKU0Uu2Y
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/task-historics" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxOTgzNWZiMy02NzgzLTQ5NzEtOTk3YS0xYmZjY2I4NjdiYzkiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.GHx4Wad7K7T1_KVFoGhhpdFQRnMjHZ9j7J8BKU0Uu2Y" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Response Fields

Name Description
data[id] Código identificador
data[type] Identifica o tipo do recurso
data[links][self] Endereço do recurso
data[attributes][date-time] Momento em que o histórico foi gerado
data[attributes][text] Mensagem do histórico
data[attributes][historic] Registro do conteúdo alterado
data[relationships][task] Links para a tarefa relacionada
data[relationships][person] Links para a pessoa relacionada ao histórico
links[first] Primeira página de dados
links[prev] Página anterior
links[next] Próxima página de dados
links[last] Última página de dados

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "cb262684-1962-4ae9-98e0-f3b257689251",
      "type": "task-historics",
      "links": {
        "self": "http://web.monde.com.br/api/v2/task-historics/cb262684-1962-4ae9-98e0-f3b257689251"
      },
      "attributes": {
        "date-time": "2017-11-08T00:00:00.000-02:00",
        "text": "First comment",
        "historic": null
      },
      "relationships": {
        "task": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/task-historics/cb262684-1962-4ae9-98e0-f3b257689251/relationships/task",
            "related": "http://web.monde.com.br/api/v2/task-historics/cb262684-1962-4ae9-98e0-f3b257689251/task"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/task-historics/cb262684-1962-4ae9-98e0-f3b257689251/relationships/person",
            "related": "http://web.monde.com.br/api/v2/task-historics/cb262684-1962-4ae9-98e0-f3b257689251/person"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/task-historics?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/task-historics?page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Buscar pelo identificador

Busca um cadastro através do seu código identificador(id)

Endpoint

GET api/v2/task-historics/:id

Parameters

Name Description
id Required Código identificador do histórico da tarefa

Request

Route

GET api/v2/task-historics/c3229f34-5a8d-4f29-b15b-b999ed3bba07

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJmNDRmODYzMi0wZmEyLTQzYjQtODA3Yi1mMzYzMWYxMWIwM2EiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.i-NHYxBSCB53sUpWRKOU3nqNZqJseG7N7VqgZbAgKgM
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/task-historics/c3229f34-5a8d-4f29-b15b-b999ed3bba07" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJmNDRmODYzMi0wZmEyLTQzYjQtODA3Yi1mMzYzMWYxMWIwM2EiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.i-NHYxBSCB53sUpWRKOU3nqNZqJseG7N7VqgZbAgKgM" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "c3229f34-5a8d-4f29-b15b-b999ed3bba07",
    "type": "task-historics",
    "links": {
      "self": "http://web.monde.com.br/api/v2/task-historics/c3229f34-5a8d-4f29-b15b-b999ed3bba07"
    },
    "attributes": {
      "date-time": "2017-11-08T00:00:00.000-02:00",
      "text": "First comment",
      "historic": null
    },
    "relationships": {
      "task": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/task-historics/c3229f34-5a8d-4f29-b15b-b999ed3bba07/relationships/task",
          "related": "http://web.monde.com.br/api/v2/task-historics/c3229f34-5a8d-4f29-b15b-b999ed3bba07/task"
        }
      },
      "person": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/task-historics/c3229f34-5a8d-4f29-b15b-b999ed3bba07/relationships/person",
          "related": "http://web.monde.com.br/api/v2/task-historics/c3229f34-5a8d-4f29-b15b-b999ed3bba07/person"
        }
      }
    }
  }
}

Registar um histórico de tarefa

Endpoint

POST api/v2/task-historics

Parameters

Name Description
type Required Tipo do recurso. Deve ser informado sempre como `task-historics`.
attributes[text] Mensagem de histórico
relationships[task] Required Tarefa que o histórico é vinculado

Request

Route

POST api/v2/task-historics

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YTllYjk3Ny1jMTc4LTRkYmEtODYxMC04NDYwNjgzZGZhMjEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.0KNvm6ZfHUt_QnpIACw77J33Csg_PDByx0HcTzwMj9A
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "task-historics",
    "attributes": {
      "text": "First comment"
    },
    "relationships": {
      "task": {
        "data": {
          "id": "0ca5e71a-7e09-4a18-9eaa-86c2f212299f",
          "type": "tasks"
        }
      }
    }
  }
}

Curl

curl "https://web.monde.com.br/api/v2/task-historics" -d '{"data":{"type":"task-historics","attributes":{"text":"First comment"},"relationships":{"task":{"data":{"id":"0ca5e71a-7e09-4a18-9eaa-86c2f212299f","type":"tasks"}}}}}' -X POST \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YTllYjk3Ny1jMTc4LTRkYmEtODYxMC04NDYwNjgzZGZhMjEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.0KNvm6ZfHUt_QnpIACw77J33Csg_PDByx0HcTzwMj9A" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

201

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "9f0c3177-bb69-47bf-a4eb-4d56328e52cb",
    "type": "task-historics",
    "links": {
      "self": "http://web.monde.com.br/api/v2/task-historics/9f0c3177-bb69-47bf-a4eb-4d56328e52cb"
    },
    "attributes": {
      "date-time": "2017-11-09T15:18:43.723-02:00",
      "text": "First comment",
      "historic": null
    },
    "relationships": {
      "task": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/task-historics/9f0c3177-bb69-47bf-a4eb-4d56328e52cb/relationships/task",
          "related": "http://web.monde.com.br/api/v2/task-historics/9f0c3177-bb69-47bf-a4eb-4d56328e52cb/task"
        }
      },
      "person": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/task-historics/9f0c3177-bb69-47bf-a4eb-4d56328e52cb/relationships/person",
          "related": "http://web.monde.com.br/api/v2/task-historics/9f0c3177-bb69-47bf-a4eb-4d56328e52cb/person"
        }
      }
    }
  }
}

Editar um cadastro

Endpoint

PATCH api/v2/task-historics/:_id

Parameters

Name Description
type Required Tipo do recurso. Deve ser informado sempre como `task-historics`.
id Required ID do histórico de tarefa a ser alterada.
attributes[text] Mensagem de histórico

Request

Route

PATCH api/v2/task-historics/4acb2188-89fa-4cd1-8afe-989d8e865de2

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxZjk1ZDk4Yi1jZWU2LTQ0OTMtOTY1ZC1iMDkxMWJjY2JjNDYiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.SU1Mvm4t-cyribSyxSoZtchMGnui-G885b2eKd30ZTI
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "task-historics",
    "id": "4acb2188-89fa-4cd1-8afe-989d8e865de2",
    "attributes": {
      "text": "First comment edited"
    }
  }
}

Curl

curl "https://web.monde.com.br/api/v2/task-historics/4acb2188-89fa-4cd1-8afe-989d8e865de2" -d '{"data":{"type":"task-historics","id":"4acb2188-89fa-4cd1-8afe-989d8e865de2","attributes":{"text":"First comment edited"}}}' -X PATCH \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxZjk1ZDk4Yi1jZWU2LTQ0OTMtOTY1ZC1iMDkxMWJjY2JjNDYiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.SU1Mvm4t-cyribSyxSoZtchMGnui-G885b2eKd30ZTI" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "4acb2188-89fa-4cd1-8afe-989d8e865de2",
    "type": "task-historics",
    "links": {
      "self": "http://web.monde.com.br/api/v2/task-historics/4acb2188-89fa-4cd1-8afe-989d8e865de2"
    },
    "attributes": {
      "date-time": "2017-11-08T00:00:00.000-02:00",
      "text": "First comment edited",
      "historic": null
    },
    "relationships": {
      "task": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/task-historics/4acb2188-89fa-4cd1-8afe-989d8e865de2/relationships/task",
          "related": "http://web.monde.com.br/api/v2/task-historics/4acb2188-89fa-4cd1-8afe-989d8e865de2/task"
        }
      },
      "person": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/task-historics/4acb2188-89fa-4cd1-8afe-989d8e865de2/relationships/person",
          "related": "http://web.monde.com.br/api/v2/task-historics/4acb2188-89fa-4cd1-8afe-989d8e865de2/person"
        }
      }
    }
  }
}

Excluir histórico de tarefa pelo ID

Endpoint

DELETE api/v2/task-historics/:id

Parameters

Name Description
id Required ID do histórico de tarefa a ser excluído.

Request

Route

DELETE api/v2/task-historics/97f51557-d7ca-4ae7-af28-a83119a8c2e6

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjZDI5ZjNhYy1mMzUyLTQ4YzEtYTc0Yy00MDEwNTgxMmEyMzAiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.5WFm4lXHDZZEBmg2QqRuRpXsviOZomQY2-fuNJcgKcw
Content-Type: application/vnd.api+json

Curl

curl "https://web.monde.com.br/api/v2/task-historics/97f51557-d7ca-4ae7-af28-a83119a8c2e6" -d '' -X DELETE \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjZDI5ZjNhYy1mMzUyLTQ4YzEtYTc0Yy00MDEwNTgxMmEyMzAiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTAyNTE1MjN9.5WFm4lXHDZZEBmg2QqRuRpXsviOZomQY2-fuNJcgKcw" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

204

Tarefas

Gerencia os cadastros de tarefas

Acesso somente com autenticação

Retorna um erro de autenticação caso o token seja incorreto ou não informado.

Endpoint

GET api/v2/tasks

Request

Route

GET api/v2/tasks

Headers

Authorization: Bearer token-invalido
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/tasks" -X GET \
	-H "Authorization: Bearer token-invalido" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

401

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Erro de autenticação",
      "detail": "O token de autenticação fornecido está expirado ou é inválido",
      "code": "401",
      "status": "401"
    }
  ]
}

Validar permissão para visualizar tarefas

Valida as permissões de acesso para vizualizar tarefas.

Quando não há permissão, um erro de autorização é enviado como resposta.

Endpoint

GET api/v2/tasks

Request

Route

GET api/v2/tasks

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI0YWFlNjMyYy02ZTY3LTRmMjgtYmY4Mi03OWY5ZjYxZGIxMTYiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzF9.xA9nyYXjtYHODsdNLK4eLgn9N13u4KIsHRezBvb8ns8
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/tasks" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI0YWFlNjMyYy02ZTY3LTRmMjgtYmY4Mi03OWY5ZjYxZGIxMTYiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzF9.xA9nyYXjtYHODsdNLK4eLgn9N13u4KIsHRezBvb8ns8" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

403

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Sem permissão",
      "detail": "Sem permissão de acesso para essa operação",
      "code": "403",
      "status": "403"
    }
  ]
}

Buscar todos os cadastros

Retorna todos os cadastros, páginados em 50 registros

Endpoint

GET api/v2/tasks

Parameters

Name Description
page[number] Número da página
page[size] Número de registros por página

Request

Route

GET api/v2/tasks

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI3NDViZDNlNS1mNDhjLTRhNDctYTI0ZS0wZTlkMGRhZGIxNjQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.p7Ro8niRdIALw0Y7bV_jf4bEm_T7_0HT1AAMeTowTEc
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/tasks" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI3NDViZDNlNS1mNDhjLTRhNDctYTI0ZS0wZTlkMGRhZGIxNjQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.p7Ro8niRdIALw0Y7bV_jf4bEm_T7_0HT1AAMeTowTEc" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Response Fields

Name Description
data[id] Código identificador
data[type] Identifica o tipo do recurso
data[links][self] Endereço do recurso
data[attributes][title] Título da tarefa
data[attributes][number] Numeração sequêncial da tarefa
data[attributes][due] Data de vencimento
data[attributes][visualized] Tarefa foi visualizada pelo responsável
data[attributes][completed] Sinaliza se a tarefa foi/deve ser concluída
data[attributes][completed-at] Data de conclusão
data[attributes][registered-at] Data de cadastro
data[relationships][assignee] Links para o responsável
data[relationships][person] Links para a pessoa relacionada na tarefa
data[relationships][author] Links para a pessoa que criou a tarefa
data[relationships][category] Links para a categoria
links[first] Primeira página de dados
links[prev] Página anterior
links[next] Próxima página de dados
links[last] Última página de dados

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "7fbd950f-8d32-4d9d-9664-9b7855825b95",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95"
      },
      "attributes": {
        "title": "Quae eligendi adipisci repudiandae labore distinctio odio cupiditate exercitationem.",
        "number": 7,
        "due": "2018-04-04T00:00:00.000-03:00",
        "visualized": false,
        "completed": false,
        "completed-at": null,
        "registered-at": "2018-04-03T15:00:41.425-03:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/category"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/person"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/assignee"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/7fbd950f-8d32-4d9d-9664-9b7855825b95/task-historics"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar tarefas pelo título

Filtra tarefas pelo título informado

Endpoint

GET api/v2/tasks?filter[search]=:search

Parameters

Name Description
filter[search] Filtra tarefas pelo título

Request

Route

GET api/v2/tasks?filter[search]=Find

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlZmM5NDFkNC1lNjQyLTRlMzItOWI5Mi1kNTI3MmJiNzE4NDMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.QV_TgExSp3vVVo7yvCvH7URd4Rv6LSO_iDra86gnFTo
Content-Type: application/vnd.api+json

Query Parameters

filter={"search"=>"Find"}

Curl

curl -g "https://web.monde.com.br/api/v2/tasks?filter[search]=Find" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlZmM5NDFkNC1lNjQyLTRlMzItOWI5Mi1kNTI3MmJiNzE4NDMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.QV_TgExSp3vVVo7yvCvH7URd4Rv6LSO_iDra86gnFTo" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "cce014f7-9cf9-459e-b16a-8c3ef8ee0c97",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97"
      },
      "attributes": {
        "title": "Find me",
        "number": 8,
        "due": "2018-04-04T00:00:00.000-03:00",
        "visualized": false,
        "completed": false,
        "completed-at": null,
        "registered-at": "2018-04-03T15:00:41.614-03:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/category"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/person"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/assignee"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/cce014f7-9cf9-459e-b16a-8c3ef8ee0c97/task-historics"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?filter%5Bsearch%5D=Find&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?filter%5Bsearch%5D=Find&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar tarefas finalizadas

Filtra tarefas pelo situação de finalizada (done)

Endpoint

GET api/v2/tasks?filter[situation]=:situation

Parameters

Name Description
filter[situation]=done Filtra as tarefas finalizadas

Request

Route

GET api/v2/tasks?filter[situation]=done

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIwYzgyNTY0ZS1hODFlLTRhMzMtYTI3ZC01ZTQ4ZDg3M2QyZTYiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.LCYv64mxb2_pwt1CI95S4z501SbgIpZyKkKEFDluY34
Content-Type: application/vnd.api+json

Query Parameters

filter={"situation"=>"done"}

Curl

curl -g "https://web.monde.com.br/api/v2/tasks?filter[situation]=done" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIwYzgyNTY0ZS1hODFlLTRhMzMtYTI3ZC01ZTQ4ZDg3M2QyZTYiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.LCYv64mxb2_pwt1CI95S4z501SbgIpZyKkKEFDluY34" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "0c169208-2141-42f5-badf-5df997a36c6c",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c"
      },
      "attributes": {
        "title": "Et omnis non quas laboriosam nisi rerum a.",
        "number": 9,
        "due": "2018-04-04T00:00:00.000-03:00",
        "visualized": false,
        "completed": true,
        "completed-at": "2018-04-03T15:00:41.707-03:00",
        "registered-at": "2018-04-03T15:00:41.722-03:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/category"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/person"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/assignee"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/0c169208-2141-42f5-badf-5df997a36c6c/task-historics"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?filter%5Bsituation%5D=done&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?filter%5Bsituation%5D=done&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar tarefas em aberto

Filtra tarefas pelo situação de não concluída (open)

Endpoint

GET api/v2/tasks?filter[situation]=:situation

Parameters

Name Description
filter[situation]=open Filtra as tarefas não concluídas

Request

Route

GET api/v2/tasks?filter[situation]=open

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlMmEzY2ExYy1iZDA3LTRiMjctOGRhZi1jZmFlZjkxOWE4MjIiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.BuEIZSYkpOLRGDthwpHDCUfME4uYUDTQGSI1-8sflaY
Content-Type: application/vnd.api+json

Query Parameters

filter={"situation"=>"open"}

Curl

curl -g "https://web.monde.com.br/api/v2/tasks?filter[situation]=open" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlMmEzY2ExYy1iZDA3LTRiMjctOGRhZi1jZmFlZjkxOWE4MjIiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.BuEIZSYkpOLRGDthwpHDCUfME4uYUDTQGSI1-8sflaY" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "2df78f9d-59a4-4a84-9316-6ee869262e7e",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e"
      },
      "attributes": {
        "title": "Minima voluptates et dolore consequuntur et molestiae qui similique.",
        "number": 10,
        "due": "2018-04-04T00:00:00.000-03:00",
        "visualized": false,
        "completed": false,
        "completed-at": null,
        "registered-at": "2018-04-03T15:00:41.829-03:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/category"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/person"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/assignee"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/2df78f9d-59a4-4a84-9316-6ee869262e7e/task-historics"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?filter%5Bsituation%5D=open&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?filter%5Bsituation%5D=open&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar tarefas do usuário

Filtra tarefas em que o usuário é responsável

Endpoint

GET api/v2/tasks?filter[assigned]=:assigned

Parameters

Name Description
filter[assigned]=user_tasks Tarefas do usuário

Request

Route

GET api/v2/tasks?filter[assigned]=user_tasks

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2NzgxN2MyYi05NzhhLTRlYTctYjhhZS01YTI2YmM4MmRjYzkiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.r-nUZOqQt44kFD1GlIojEDOqZYFS1qQCimBWKVJ-azw
Content-Type: application/vnd.api+json

Query Parameters

filter={"assigned"=>"user_tasks"}

Curl

curl -g "https://web.monde.com.br/api/v2/tasks?filter[assigned]=user_tasks" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2NzgxN2MyYi05NzhhLTRlYTctYjhhZS01YTI2YmM4MmRjYzkiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDF9.r-nUZOqQt44kFD1GlIojEDOqZYFS1qQCimBWKVJ-azw" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "9f2d1a74-449c-4c51-92dc-8c5a7c909ece",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece"
      },
      "attributes": {
        "title": "Aut consectetur error quae possimus molestiae impedit.",
        "number": 11,
        "due": "2018-04-04T00:00:00.000-03:00",
        "visualized": false,
        "completed": false,
        "completed-at": null,
        "registered-at": "2018-04-03T15:00:41.931-03:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/category"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/person"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/assignee"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/9f2d1a74-449c-4c51-92dc-8c5a7c909ece/task-historics"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?filter%5Bassigned%5D=user_tasks&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?filter%5Bassigned%5D=user_tasks&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar tarefas delegadas pelo usuário

Filtra tarefas em que o usuário delegou

Endpoint

GET api/v2/tasks?filter[assigned]=:assigned

Parameters

Name Description
filter[assigned]=delegated Tarefas delegadas pelo usuário

Request

Route

GET api/v2/tasks?filter[assigned]=delegated

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJmMTU0ZTE1YS03ODczLTQ4N2MtODg1Ni03OWY4MjU3ZGYzYzMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.4_cvDWP35mj5ntpif1nkHnWk0yrnz-E2mOq4eReEA3I
Content-Type: application/vnd.api+json

Query Parameters

filter={"assigned"=>"delegated"}

Curl

curl -g "https://web.monde.com.br/api/v2/tasks?filter[assigned]=delegated" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJmMTU0ZTE1YS03ODczLTQ4N2MtODg1Ni03OWY4MjU3ZGYzYzMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.4_cvDWP35mj5ntpif1nkHnWk0yrnz-E2mOq4eReEA3I" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "54323e4c-6ebd-4a08-b159-8d3a0ea82dec",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec"
      },
      "attributes": {
        "title": "Similique voluptatibus quo in amet possimus.",
        "number": 12,
        "due": "2018-04-04T00:00:00.000-03:00",
        "visualized": false,
        "completed": false,
        "completed-at": null,
        "registered-at": "2018-04-03T15:00:42.091-03:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/category"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/person"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/assignee"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/54323e4c-6ebd-4a08-b159-8d3a0ea82dec/task-historics"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?filter%5Bassigned%5D=delegated&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?filter%5Bassigned%5D=delegated&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar tarefas criadas pelo usuário

Filtra tarefas que o usuário é o criador/autor

Endpoint

GET api/v2/tasks?filter[assigned]=:assigned

Parameters

Name Description
filter[assigned]=author Tarefas criadas pelo usuário

Request

Route

GET api/v2/tasks?filter[assigned]=author

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI3YTM2ZjJiYy0xZWVhLTQ3YTEtYTdlZi1kZWI4ODQxYjkxNDQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.aLoowvhRvOO92OIDVa_VexN5Gl8eznGDjKqlDI8968U
Content-Type: application/vnd.api+json

Query Parameters

filter={"assigned"=>"author"}

Curl

curl -g "https://web.monde.com.br/api/v2/tasks?filter[assigned]=author" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI3YTM2ZjJiYy0xZWVhLTQ3YTEtYTdlZi1kZWI4ODQxYjkxNDQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.aLoowvhRvOO92OIDVa_VexN5Gl8eznGDjKqlDI8968U" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "64a0d281-577d-46bb-a154-979410273210",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210"
      },
      "attributes": {
        "title": "Laboriosam sapiente quod in alias laborum.",
        "number": 13,
        "due": "2018-04-04T00:00:00.000-03:00",
        "visualized": false,
        "completed": false,
        "completed-at": null,
        "registered-at": "2018-04-03T15:00:42.232-03:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/category"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/person"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/assignee"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/64a0d281-577d-46bb-a154-979410273210/task-historics"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?filter%5Bassigned%5D=author&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?filter%5Bassigned%5D=author&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar tarefas até uma data

Filtra tarefas que vencem até a data informada.

Endpoint

GET api/v2/tasks?filter[due_until]=:due_until

Parameters

Name Description
filter[due_until]=2017-12-31 Filtra as tarefas que vencem até a data limite

Request

Route

GET api/v2/tasks?filter[due_until]=2017-12-31

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI0MjNlNjU0Ni1kZmYxLTRkYzctYjA2MC03OGM5NjZlMmI1YzUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.XIU7_auGi7qBT_Xp3r_GCu1uhtXSzW7C0-5CIq8sMTc
Content-Type: application/vnd.api+json

Query Parameters

filter={"due_until"=>"2017-12-31"}

Curl

curl -g "https://web.monde.com.br/api/v2/tasks?filter[due_until]=2017-12-31" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI0MjNlNjU0Ni1kZmYxLTRkYzctYjA2MC03OGM5NjZlMmI1YzUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.XIU7_auGi7qBT_Xp3r_GCu1uhtXSzW7C0-5CIq8sMTc" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "192698dc-451e-436f-b858-45a82480143d",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d"
      },
      "attributes": {
        "title": "Accusamus rerum consequatur magni magnam perspiciatis ad tenetur.",
        "number": 14,
        "due": "2017-12-31T00:00:00.000-02:00",
        "visualized": false,
        "completed": false,
        "completed-at": null,
        "registered-at": "2018-04-03T15:00:42.335-03:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/category"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/person"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/assignee"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/192698dc-451e-436f-b858-45a82480143d/task-historics"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?filter%5Bdue_until%5D=2017-12-31&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?filter%5Bdue_until%5D=2017-12-31&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Filtrar tarefas até hoje

Filtra tarefas que vencem até o fim do dia de hoje.

Endpoint

GET api/v2/tasks?filter[due_until]=:due_until

Parameters

Name Description
filter[due_until]=today Filtra todas as tarefas que vencem até o fim do dia de hoje

Request

Route

GET api/v2/tasks?filter[due_until]=today

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIzN2Q0ZjJkZC1mYzA0LTQ5MWYtYjVjNi1mMjlhZDJhYWRmMDEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.LB1KTPgeDu5f_DU0Rw-DI9JVQ0hcb4GJ4g30CrS4YGw
Content-Type: application/vnd.api+json

Query Parameters

filter={"due_until"=>"today"}

Curl

curl -g "https://web.monde.com.br/api/v2/tasks?filter[due_until]=today" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIzN2Q0ZjJkZC1mYzA0LTQ5MWYtYjVjNi1mMjlhZDJhYWRmMDEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.LB1KTPgeDu5f_DU0Rw-DI9JVQ0hcb4GJ4g30CrS4YGw" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "78e27acd-6b09-4031-bec7-d8d027f5f92f",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f"
      },
      "attributes": {
        "title": "Quaerat veritatis reiciendis magnam quas.",
        "number": 15,
        "due": "2018-04-03T15:00:42.423-03:00",
        "visualized": false,
        "completed": false,
        "completed-at": null,
        "registered-at": "2018-04-03T15:00:42.435-03:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/category"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/person"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/assignee"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/78e27acd-6b09-4031-bec7-d8d027f5f92f/task-historics"
          }
        }
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?filter%5Bdue_until%5D=today&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?filter%5Bdue_until%5D=today&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Carrega dados dos relacionamentos

Carrega relacionamentos e campos específicos

Endpoint

GET api/v2/tasks?include=assignee,person,category&fields[people]=name

Parameters

Name Description
include=assignee,person,category Inclui dados de relacionamentos. Também é possível recuperar dados de relacionamentos em níveis internos, ex,: person.city
fields[people]=name Inclui campos específicos de um relacionamento.

Request

Route

GET api/v2/tasks?include=assignee,person,category&fields[people]=name

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2Yjc2MmFkMy0xYjE2LTQxN2ItODkwNi05OGZmOGQ0YTMzNjMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTc4NDI4ODh9.M89v1C6BvVJo6p49RdJ3iPNs-H6qnpTIwCNhZCvd-ss
Content-Type: application/vnd.api+json

Query Parameters

include=assignee,person,category
fields={"people"=>"name"}

Curl

curl -g "https://web.monde.com.br/api/v2/tasks?include=assignee,person,category&fields[people]=name" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2Yjc2MmFkMy0xYjE2LTQxN2ItODkwNi05OGZmOGQ0YTMzNjMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTc4NDI4ODh9.M89v1C6BvVJo6p49RdJ3iPNs-H6qnpTIwCNhZCvd-ss" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": [
    {
      "id": "a70af94b-bbe2-473c-a9b5-c215199f4334",
      "type": "tasks",
      "links": {
        "self": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334"
      },
      "attributes": {
        "title": "Suscipit aperiam velit nihil unde.",
        "number": 15,
        "due": "2018-02-05T12:01:28.969-02:00",
        "visualized": false,
        "completed-at": null,
        "registered-at": "2018-02-05T12:01:28.982-02:00"
      },
      "relationships": {
        "category": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/relationships/category",
            "related": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/category"
          },
          "data": {
            "type": "task-categories",
            "id": "Geral"
          }
        },
        "person": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/relationships/person",
            "related": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/person"
          },
          "data": {
            "type": "people",
            "id": "c6c154d0-9a36-4025-8c35-fb05eeb26984"
          }
        },
        "assignee": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/relationships/assignee",
            "related": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/assignee"
          },
          "data": {
            "type": "people",
            "id": "6b762ad3-1b16-417b-8906-98ff8d4a3363"
          }
        },
        "author": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/relationships/author",
            "related": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/author"
          }
        },
        "task-historics": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/relationships/task-historics",
            "related": "http://web.monde.com.br/api/v2/tasks/a70af94b-bbe2-473c-a9b5-c215199f4334/task-historics"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "Geral",
      "type": "task-categories",
      "links": {
        "self": "http://web.monde.com.br/api/v2/task-categories/Geral"
      },
      "attributes": {
        "description": "Geral"
      },
      "relationships": {
        "tasks": {
          "links": {
            "self": "http://web.monde.com.br/api/v2/task-categories/Geral/relationships/tasks",
            "related": "http://web.monde.com.br/api/v2/task-categories/Geral/tasks"
          }
        }
      }
    },
    {
      "id": "c6c154d0-9a36-4025-8c35-fb05eeb26984",
      "type": "people",
      "links": {
        "self": "http://web.monde.com.br/api/v2/people/c6c154d0-9a36-4025-8c35-fb05eeb26984"
      },
      "attributes": {
        "name": "Company One"
      }
    },
    {
      "id": "6b762ad3-1b16-417b-8906-98ff8d4a3363",
      "type": "people",
      "links": {
        "self": "http://web.monde.com.br/api/v2/people/6b762ad3-1b16-417b-8906-98ff8d4a3363"
      },
      "attributes": {
        "name": "Company One"
      }
    }
  ],
  "links": {
    "first": "http://web.monde.com.br/api/v2/tasks?fields%5Bpeople%5D=name&include=assignee%2Cperson%2Ccategory&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "http://web.monde.com.br/api/v2/tasks?fields%5Bpeople%5D=name&include=assignee%2Cperson%2Ccategory&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Buscar pelo identificador

Busca um cadastro através do seu código identificador(id)

Endpoint

GET api/v2/tasks/:id

Parameters

Name Description
id Required Código identificador da tarefa

Request

Route

GET api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2MmY1MTc3Yi1kYjZiLTQ5YTMtOTA2Yy1mYmY0N2Q0N2IzZDUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.PuOgcx81lV3gzRIFV8NDYDbLjneb3YE76mhROLUhLz8
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2MmY1MTc3Yi1kYjZiLTQ5YTMtOTA2Yy1mYmY0N2Q0N2IzZDUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.PuOgcx81lV3gzRIFV8NDYDbLjneb3YE76mhROLUhLz8" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "15a75d4c-2231-4791-8532-553f031d16c4",
    "type": "tasks",
    "links": {
      "self": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4"
    },
    "attributes": {
      "title": "Sint ab consequatur deserunt.",
      "number": 17,
      "due": "2018-04-04T00:00:00.000-03:00",
      "visualized": true,
      "completed": false,
      "completed-at": null,
      "registered-at": "2018-04-03T15:00:42.640-03:00"
    },
    "relationships": {
      "category": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/relationships/category",
          "related": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/category"
        }
      },
      "person": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/relationships/person",
          "related": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/person"
        }
      },
      "assignee": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/relationships/assignee",
          "related": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/assignee"
        }
      },
      "author": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/relationships/author",
          "related": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/author"
        }
      },
      "task-historics": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/relationships/task-historics",
          "related": "http://web.monde.com.br/api/v2/tasks/15a75d4c-2231-4791-8532-553f031d16c4/task-historics"
        }
      }
    }
  }
}

Validar permissão para visualizar tarefa

Valida as permissões de acesso para vizualizar tarefa.

Quando não há permissão, um erro de autorização é enviado como resposta.

Endpoint

GET api/v2/tasks/:id

Parameters

Name Description
id Required Código identificador da tarefa

Request

Route

GET api/v2/tasks/7fedbfae-6ac8-44f2-804b-c8ff27d892b6

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI3MTJiMjhkMC04NTkxLTRhMGQtOTIzOC1hNjYwNDUxMGExNmUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzJ9.qQ99XbjC1DGZ-LmgPZdRp2mT-upodb50QNpXpILJUUE
Content-Type: application/vnd.api+json

Curl

curl -g "https://web.monde.com.br/api/v2/tasks/7fedbfae-6ac8-44f2-804b-c8ff27d892b6" -X GET \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI3MTJiMjhkMC04NTkxLTRhMGQtOTIzOC1hNjYwNDUxMGExNmUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzJ9.qQ99XbjC1DGZ-LmgPZdRp2mT-upodb50QNpXpILJUUE" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

403

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Sem permissão",
      "detail": "Sem permissão de acesso para essa operação",
      "code": "403",
      "status": "403"
    }
  ]
}

Cadastrar uma tarefa

Endpoint

POST api/v2/tasks

Parameters

Name Description
type Required Tipo do recurso. Deve ser informado sempre como `tasks`.
attributes[title] Required Título da tarefa
attributes[due] Required Data de vencimento
attributes[completed] Finaliza a tarefa
relationships[category] Required Categoria da tarefa
relationships[assignee] Required Pessoa responsável pela tarefa
relationships[person] Pessoa relacionada a tarefa

Request

Route

POST api/v2/tasks

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJhZDNjNTk0ZS1mZDYyLTQxNzQtYWY3My03MmYzN2Q4OTVlYWQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.5mLdRBCLlNPEdKhKpZtiIiJCbqUy6flGsP1zgfegBeA
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "tasks",
    "attributes": {
      "title": "Task One",
      "due": "2018-04-05T15:00:42.771-03:00",
      "completed": true
    },
    "relationships": {
      "category": {
        "data": {
          "id": "Geral",
          "type": "task-categories"
        }
      },
      "assignee": {
        "data": {
          "id": "ad3c594e-fd62-4174-af73-72f37d895ead",
          "type": "people"
        }
      },
      "person": {
        "data": {
          "id": "ad3c594e-fd62-4174-af73-72f37d895ead",
          "type": "people"
        }
      }
    }
  }
}

Curl

curl "https://web.monde.com.br/api/v2/tasks" -d '{"data":{"type":"tasks","attributes":{"title":"Task One","due":"2018-04-05T15:00:42.771-03:00","completed":true},"relationships":{"category":{"data":{"id":"Geral","type":"task-categories"}},"assignee":{"data":{"id":"ad3c594e-fd62-4174-af73-72f37d895ead","type":"people"}},"person":{"data":{"id":"ad3c594e-fd62-4174-af73-72f37d895ead","type":"people"}}}}}' -X POST \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJhZDNjNTk0ZS1mZDYyLTQxNzQtYWY3My03MmYzN2Q4OTVlYWQiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.5mLdRBCLlNPEdKhKpZtiIiJCbqUy6flGsP1zgfegBeA" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

201

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "144f3402-b63b-4233-8816-3aed2ab190e5",
    "type": "tasks",
    "links": {
      "self": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5"
    },
    "attributes": {
      "title": "Task One",
      "number": 19,
      "due": "2018-04-05T15:00:42.771-03:00",
      "visualized": true,
      "completed": true,
      "completed-at": "2018-04-03T15:00:42.793-03:00",
      "registered-at": "2018-04-03T15:00:42.795-03:00"
    },
    "relationships": {
      "category": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/relationships/category",
          "related": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/category"
        }
      },
      "person": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/relationships/person",
          "related": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/person"
        }
      },
      "assignee": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/relationships/assignee",
          "related": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/assignee"
        }
      },
      "author": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/relationships/author",
          "related": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/author"
        }
      },
      "task-historics": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/relationships/task-historics",
          "related": "http://web.monde.com.br/api/v2/tasks/144f3402-b63b-4233-8816-3aed2ab190e5/task-historics"
        }
      }
    }
  }
}

Formato das validações de cadastro

Endpoint

POST api/v2/tasks

Parameters

Name Description
type Required Tipo do recurso. Deve ser informado sempre como `tasks`.

Request

Route

POST api/v2/tasks

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlNTA1MTA0ZC0zMDQ3LTRkMTItOTNiYi02YTUwNjNhMTM3OWEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzJ9.nWrokDmGO3lLDWQ8IWDQGThmonL6tE1LObWtsXZJ6O4
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "tasks"
  }
}

Curl

curl "https://web.monde.com.br/api/v2/tasks" -d '{"data":{"type":"tasks"}}' -X POST \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlNTA1MTA0ZC0zMDQ3LTRkMTItOTNiYi02YTUwNjNhMTM3OWEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzJ9.nWrokDmGO3lLDWQ8IWDQGThmonL6tE1LObWtsXZJ6O4" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

422

Headers

Content-Type: application/vnd.api+json

Body

{
  "errors": [
    {
      "title": "não pode ficar em branco",
      "detail": "title - não pode ficar em branco",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/title"
      },
      "status": "422"
    },
    {
      "title": "não pode ficar em branco",
      "detail": "assignee - não pode ficar em branco",
      "code": "100",
      "source": {
        "pointer": "/data/relationships/assignee"
      },
      "status": "422"
    },
    {
      "title": "não pode ficar em branco",
      "detail": "due - não pode ficar em branco",
      "code": "100",
      "source": {
        "pointer": "/data/attributes/due"
      },
      "status": "422"
    },
    {
      "title": "não pode ficar em branco",
      "detail": "category - não pode ficar em branco",
      "code": "100",
      "source": {
        "pointer": "/data/relationships/category"
      },
      "status": "422"
    }
  ]
}

Editar um cadastro

Endpoint

PATCH api/v2/tasks/:_id

Parameters

Name Description
type Required Tipo do recurso. Deve ser informado sempre como `tasks`.
id Required ID da tarefa a ser alterada.
attributes[title] Required Título da tarefa.

Request

Route

PATCH api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1NWVmYTQyYi05MmRlLTRmZGUtOThhYi05NmNiYzVhZmYyYjEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.4WgUFCDgmbQ68k19UTkv-BXOcIt93UdG_hsAHA2zwFU
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "tasks",
    "id": "c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553",
    "attributes": {
      "title": "Task One"
    }
  }
}

Curl

curl "https://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553" -d '{"data":{"type":"tasks","id":"c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553","attributes":{"title":"Task One"}}}' -X PATCH \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1NWVmYTQyYi05MmRlLTRmZGUtOThhYi05NmNiYzVhZmYyYjEiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjI3ODIwNDJ9.4WgUFCDgmbQ68k19UTkv-BXOcIt93UdG_hsAHA2zwFU" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553",
    "type": "tasks",
    "links": {
      "self": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553"
    },
    "attributes": {
      "title": "Task One",
      "number": 20,
      "due": "2018-04-04T00:00:00.000-03:00",
      "visualized": true,
      "completed": false,
      "completed-at": null,
      "registered-at": "2018-04-03T15:00:42.966-03:00"
    },
    "relationships": {
      "category": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/relationships/category",
          "related": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/category"
        }
      },
      "person": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/relationships/person",
          "related": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/person"
        }
      },
      "assignee": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/relationships/assignee",
          "related": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/assignee"
        }
      },
      "author": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/relationships/author",
          "related": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/author"
        }
      },
      "task-historics": {
        "links": {
          "self": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/relationships/task-historics",
          "related": "http://web.monde.com.br/api/v2/tasks/c5c3bcc3-9b3f-4fff-97eb-b6f6fb677553/task-historics"
        }
      }
    }
  }
}

Validar permissões para edição

Valida as permissões para editar um cadastro de tarefa.

Endpoint

PATCH api/v2/tasks/:_id

Parameters

Name Description
type Required Tipo do recurso. Deve ser informado sempre como `tasks`.
id Required ID da tarefa a ser alterada.

Request

Route

PATCH api/v2/tasks/53b081a1-23e4-4d02-9224-378428b05b16

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxOTQ4OTg3OC04MjY4LTQ4NjItYThkYS05NjA3MjA0OTMxMGMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzJ9.q1danRrpPKQSl8-DvyO5bwo3H56Nqq1biQ8Lg3XlSoE
Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "tasks",
    "id": "53b081a1-23e4-4d02-9224-378428b05b16"
  }
}

Curl

curl "https://web.monde.com.br/api/v2/tasks/53b081a1-23e4-4d02-9224-378428b05b16" -d '{"data":{"type":"tasks","id":"53b081a1-23e4-4d02-9224-378428b05b16"}}' -X PATCH \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIxOTQ4OTg3OC04MjY4LTQ4NjItYThkYS05NjA3MjA0OTMxMGMiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzJ9.q1danRrpPKQSl8-DvyO5bwo3H56Nqq1biQ8Lg3XlSoE" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

403

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Sem permissão",
      "detail": "Sem permissão de acesso para essa operação",
      "code": "403",
      "status": "403"
    }
  ]
}

Excluir a tarefa pelo ID

Endpoint

DELETE api/v2/tasks/:id

Parameters

Name Description
id Required ID da tarefa a ser excluída.

Request

Route

DELETE api/v2/tasks/c5da03b0-8d7e-4824-a9c8-2ebb608035af

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlNTU0NDcwZC02NzY0LTQwNWEtYWViYi0wYTBlMmY3ZGZlMTUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTc2MDAzMTZ9.AzoOth7FeyFekOJHebKQbygQJnxWBWwOUeYkVW0hHTM
Content-Type: application/vnd.api+json

Curl

curl "https://web.monde.com.br/api/v2/tasks/c5da03b0-8d7e-4824-a9c8-2ebb608035af" -d '' -X DELETE \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJlNTU0NDcwZC02NzY0LTQwNWEtYWViYi0wYTBlMmY3ZGZlMTUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MTc2MDAzMTZ9.AzoOth7FeyFekOJHebKQbygQJnxWBWwOUeYkVW0hHTM" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

204

Validar permissão para excluir

Endpoint

DELETE api/v2/tasks/:id

Parameters

Name Description
id Required ID da tarefa a ser excluída.

Request

Route

DELETE api/v2/tasks/364289c8-1bb8-4219-a99c-a203caa2dec8

Headers

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjZWNhZGIzYS03ZDVlLTRmOWQtOGEzZS1jZTBhMTMzNDdlZjkiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzN9.D4fznl474j0D558ILJoXnkKBQzZa-0ZZ-EohIr5y22M
Content-Type: application/vnd.api+json

Curl

curl "https://web.monde.com.br/api/v2/tasks/364289c8-1bb8-4219-a99c-a203caa2dec8" -d '' -X DELETE \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJjZWNhZGIzYS03ZDVlLTRmOWQtOGEzZS1jZTBhMTMzNDdlZjkiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1MjA4OTMwNzN9.D4fznl474j0D558ILJoXnkKBQzZa-0ZZ-EohIr5y22M" \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

403

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Sem permissão",
      "detail": "Sem permissão de acesso para essa operação",
      "code": "403",
      "status": "403"
    }
  ]
}

Autorização

Cria token de acesso

Retorna token de acesso quando usuário existe.

Endpoint

POST api/v2/tokens

Parameters

Name Description
type Required Tipo do recurso e deve ser sempre <code>auth</code>.
attributes[login] Required Login e endereço do usuário, ex: admin@suaagencia.monde.com.br (Para descobrir qual seu endereço veja https://link.monde.com.br/administracao-desktop-endereco-sistema.html)
attributes[password] Required Senha do usuário.
attributes[platform] Plataforma que está acessando a API. Ex: "desktop", "mobile" e "web" (Padrão: "mobile")

Request

Route

POST api/v2/tokens

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "tokens",
    "attributes": {
      "login": "admin@mondesistemas.monde.com.br",
      "password": "admin"
    }
  }
}

Curl

curl "https://web.monde.com.br/api/v2/tokens" -d '{"data":{"type":"tokens","attributes":{"login":"admin@mondesistemas.monde.com.br","password":"admin"}}}' -X POST \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

200

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "id": "de253da4-ca20-463e-afb2-22e67a1babb5",
    "type": "tokens",
    "links": {
      "self": "http://web.monde.com.br/api/v2/tokens/de253da4-ca20-463e-afb2-22e67a1babb5"
    },
    "attributes": {
      "login": "admin",
      "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJkZTI1M2RhNC1jYTIwLTQ2M2UtYWZiMi0yMmU2N2ExYmFiYjUiLCJpc3N1ZXIiOiJNb25kZSIsInNjaGVtYSI6Im1vbmRlc2lzdGVtYXMiLCJleHAiOjE1NTk1NzIyMDB9.1k2Ec7yjquG45y-wNXwM1Gvq3y3dRlhgnfn6GCocqE0"
    }
  }
}

Usuário inexistente ou incorreto

Retorna um erro de autenticação caso o token seja incorreto ou não informado.

Endpoint

POST api/v2/tokens

Parameters

Name Description
type Required Tipo do recurso e deve ser sempre <code>auth</code>.
attributes[login] Required Login do usuário.
attributes[password] Required Senha do usuário.

Request

Route

POST api/v2/tokens

Headers

Content-Type: application/vnd.api+json

Body

{
  "data": {
    "type": "tokens",
    "attributes": {
      "login": "admin@mondesistemas.monde.com.br",
      "password": "senhaerrada"
    }
  }
}

Curl

curl "https://web.monde.com.br/api/v2/tokens" -d '{"data":{"type":"tokens","attributes":{"login":"admin@mondesistemas.monde.com.br","password":"senhaerrada"}}}' -X POST \
	-H "Accept: application/vnd.api+json" \
	-H "Content-Type: application/vnd.api+json"

Response

Simulated Response

Status

401

Headers

Content-Type: application/json; charset=utf-8

Body

{
  "errors": [
    {
      "title": "Usuário ou senha inválidos",
      "detail": "Usuário ou senha informados são inválidos",
      "code": "100",
      "status": "401"
    }
  ]
}