Introduction
Documentação da API Portal do cliente - Aster
Authenticating requests
Authenticate requests to this API's endpoints by sending an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
Você pode recuperar seu token fazendo login com email e senha.
Autenticação
Endpoints para realizar ações básicas de autenticação do usuário.
Login
Endpoint para logar no sistema.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.portaldocliente.aster.com.br/v1/login',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'dickinson.sam@example.net',
'password' => ')W66vB$E!Ey][*&m"[L',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.portaldocliente.aster.com.br/v1/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"dickinson.sam@example.net\",
\"password\": \")W66vB$E!Ey][*&m\\\"[L\"
}"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "dickinson.sam@example.net",
"password": ")W66vB$E!Ey][*&m\"[L"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"access_token": "{YOUR_ACCESS_TOKEN}",
"token_type": "bearer",
"expires_in": 3600
}
Received response:
Request failed with error:
Refresh token
Endpoint que retorna os dados do usuário autenticado.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.portaldocliente.aster.com.br/v1/me',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.portaldocliente.aster.com.br/v1/me" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/me"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"headers": {},
"original": {
"id": 1,
"nome": "João",
"email": "joao@email.com",
"email_verified_at": null,
"remember_token": null,
"created_at": "2022-12-06 07:10:10",
"updated_at": "2022-12-06 07:10:10"
},
"exception": null
}
Received response:
Request failed with error:
Contas
Endpoints para interagir com os contas.
Todas as contas
Endpoint que retorna as todas as contas.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.portaldocliente.aster.com.br/v1/contas',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.portaldocliente.aster.com.br/v1/contas" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/contas"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
{
"id": 1,
"nome": "Condomínio 1",
"cep": "00000001",
"endereco": "RUA UM, 001 São Paulo - SP 00000001"
},
{
"id": 2,
"nome": "Condomínio 2",
"cep": "00000002",
"endereco": "RUA DOIS, 002 São Paulo - SP 00000002"
}
}
Received response:
Request failed with error:
Todas as unidades
Endpoint que retorna as todas as unidades de uma conta.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.portaldocliente.aster.com.br/v1/contas/1',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.portaldocliente.aster.com.br/v1/contas/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/contas/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
{
"id": 1,
"nome": "Principal",
"torre": "Condomínio 1"
},
{
"id": 2,
"nome": "101",
"torre": "A"
}
}
Received response:
Request failed with error:
Convites
Endpoints para interagir com os convites.
Todos os convites
Endpoint que retorna as todos os convites.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.portaldocliente.aster.com.br/v1/convites',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'data_entrada' => '2021-01-02 22:00:00',
'data_saida' => '2021-01-02 22:00:00',
'cancelado' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.portaldocliente.aster.com.br/v1/convites" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"data_entrada\": \"2021-01-02 22:00:00\",
\"data_saida\": \"2021-01-02 22:00:00\",
\"cancelado\": false
}"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/convites"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"data_entrada": "2021-01-02 22:00:00",
"data_saida": "2021-01-02 22:00:00",
"cancelado": false
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 1,
"id_integracao": "Integracao 1",
"conta_id": 1,
"unidade_id": 1,
"descricao": "Primeiro convite",
"data_entrada": "2022-11-11 00:00:00",
"data_saida": "2022-11-11 23:59:00",
"cancelado": 0,
"criado_em": "2022-11-10 10:30:15",
"visitantes": [
{
"id": 1,
"id_integracao": null,
"nome": "João",
"cpf": "12345678910",
"documento": null,
"processado": 0,
"celular": "33999999999",
"foto": "/storage/images/visitantes/visitante-1.jpeg",
"cancelado": 0,
"criado_em": "2022-11-10 10:30:15"
}
]
}
]
}
Received response:
Request failed with error:
Inserir convite
Endpoint que insere um convite.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.portaldocliente.aster.com.br/v1/convites',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => 5.367,
'data_entrada' => '2021-01-02 22:00:00',
'data_saida' => '2021-01-02 22:00:00',
'descricao' => 'No-example',
'visitantes' => [
[
'nome' => 'No-example',
'celular' => 'No-example',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.portaldocliente.aster.com.br/v1/convites" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 5.367,
\"data_entrada\": \"2021-01-02 22:00:00\",
\"data_saida\": \"2021-01-02 22:00:00\",
\"descricao\": \"No-example\",
\"visitantes\": [
{
\"nome\": \"No-example\",
\"celular\": \"No-example\"
}
]
}"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/convites"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 5.367,
"data_entrada": "2021-01-02 22:00:00",
"data_saida": "2021-01-02 22:00:00",
"descricao": "No-example",
"visitantes": [
{
"nome": "No-example",
"celular": "No-example"
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"code": 201,
"message": "Convite cadastrado com sucesso!",
"data": {
"id": 7833,
"id_integracao": "Integracao 1",
"conta_id": 1,
"unidade_id": 1,
"descricao": "Primeiro convite",
"data_entrada": "2022-11-11 00:00:00",
"data_saida": "2022-11-11 23:59:00",
"cancelado": 0,
"criado_em": "2022-11-10 10:30:15",
"visitantes": [
{
"id": 25929,
"id_integracao": null,
"nome": "Maria",
"cpf": "12345678910",
"documento": null,
"celular": "11999999999",
"foto": null,
"cancelado": 0,
"criado_em": "2022-11-10 10:30:15"
}
]
}
}
Received response:
Request failed with error:
Editar convite
Endpoint que edita um convite.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://api.portaldocliente.aster.com.br/v1/convites/12651',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'data_entrada' => '2021-01-02 22:00:00',
'data_saida' => '2021-01-02 22:00:00',
'visitantes' => [
[],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.portaldocliente.aster.com.br/v1/convites/12651" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"data_entrada\": \"2021-01-02 22:00:00\",
\"data_saida\": \"2021-01-02 22:00:00\",
\"visitantes\": [
[]
]
}"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/convites/12651"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"data_entrada": "2021-01-02 22:00:00",
"data_saida": "2021-01-02 22:00:00",
"visitantes": [
[]
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"code": 200,
"message": "Convite atualizado com sucesso!",
"data": {
"id": 1,
"id_integracao": "Integracao 1",
"conta_id": 1,
"unidade_id": 1,
"descricao": "Primeiro convite",
"data_entrada": "2022-11-11 00:00:00",
"data_saida": "2022-11-11 23:59:00",
"cancelado": 0,
"criado_em": "2022-11-10 10:30:15",
"visitantes": [
{
"id": 1,
"id_integracao": null,
"nome": "João",
"cpf": "12345678910",
"documento": null,
"celular": "33999999999",
"foto": "/storage/images/visitantes/visitante-1.jpeg",
"cancelado": 0,
"criado_em": "2022-11-10 10:30:15"
},
{
"id": 2,
"id_integracao": null,
"nome": "Maria",
"cpf": "12345678911",
"documento": null,
"celular": "33999999999",
"foto": "/storage/images/visitantes/visitante-2.jpeg",
"cancelado": 0,
"criado_em": "2022-11-10 10:30:15"
}
]
}
}
Received response:
Request failed with error:
Cancelar convite
Endpoint que deleta um convite.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://api.portaldocliente.aster.com.br/v1/convites/12651',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.portaldocliente.aster.com.br/v1/convites/12651" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/convites/12651"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
{
"code": 200,
"message": "Convite cancelado com sucesso!",
"data": {
"id": 1,
"id_integracao": "Integracao 1",
"conta_id": 1,
"unidade_id": 1,
"descricao": "Primeiro convite",
"data_entrada": "2022-11-11 00:00:00",
"data_saida": "2022-11-11 23:59:00",
"cancelado": 1,
"criado_em": "2022-11-10 10:30:15",
"visitantes": [
{
"id": 1,
"id_integracao": null,
"nome": "João",
"cpf": "12345678910",
"documento": null,
"celular": "33999999999",
"foto": "/storage/images/visitantes/visitante-1.jpeg",
"cancelado": 1,
"criado_em": "2022-11-10 10:30:15"
},
{
"id": 2,
"id_integracao": null,
"nome": "Maria",
"cpf": "12345678911",
"documento": null,
"celular": "33999999999",
"foto": "/storage/images/visitantes/visitante-2.jpeg",
"cancelado": 1,
"criado_em": "2022-11-10 10:30:15"
}
]
}
}
Received response:
Request failed with error:
Visitantes
Endpoints para interagir com os visitantes.
Listar visitantes
Endpoint que retorna todos os visitantes.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.portaldocliente.aster.com.br/v1/visitantes',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'data_entrada' => '2021-01-02 22:00:00',
'data_saida' => '2021-01-02 22:00:00',
'cancelado' => false,
'convite_id' => 1405.0,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://api.portaldocliente.aster.com.br/v1/visitantes" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"data_entrada\": \"2021-01-02 22:00:00\",
\"data_saida\": \"2021-01-02 22:00:00\",
\"cancelado\": false,
\"convite_id\": 1405
}"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/visitantes"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"data_entrada": "2021-01-02 22:00:00",
"data_saida": "2021-01-02 22:00:00",
"cancelado": false,
"convite_id": 1405
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 1,
"conta_id": 1,
"unidade_id": 1,
"id_integracao": "Integracao 1",
"nome": "João",
"cpf": "12345678910",
"documento": null,
"celular": "33999999999",
"foto": "/storage/images/visitantes/visitante-1.jpeg",
"processado": 0,
"data_entrada": "2022-11-11 00:00:00",
"data_saida": "2022-11-11 23:59:00",
"cancelado": 0,
"criado_em": "2022-11-10 10:30:15",
"convite": null,
"hash": "",
"email": "joao@email.com",
"data_nascimento": "2002-11-10"
}
]
}
Received response:
Request failed with error:
Cadastrar visitante
Endpoint que cadastra um visitante.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.portaldocliente.aster.com.br/v1/visitantes',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => 2173.3181,
'nome' => 'No-example',
'celular' => 'No-example',
'data_entrada' => '2021-01-02 22:00:00',
'data_saida' => '2021-01-02 22:00:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://api.portaldocliente.aster.com.br/v1/visitantes" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 2173.3181,
\"nome\": \"No-example\",
\"celular\": \"No-example\",
\"data_entrada\": \"2021-01-02 22:00:00\",
\"data_saida\": \"2021-01-02 22:00:00\"
}"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/visitantes"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 2173.3181,
"nome": "No-example",
"celular": "No-example",
"data_entrada": "2021-01-02 22:00:00",
"data_saida": "2021-01-02 22:00:00"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"code": 201,
"message": "Visitante cadastrado com sucesso!",
"data": {
"id": 1,
"conta_id": 1,
"unidade_id": 1,
"id_integracao": null,
"nome": "João",
"cpf": "12345678910",
"documento": null,
"celular": "33999999999",
"foto": null,
"data_entrada": "2022-11-11 00:00:00",
"data_saida": "2022-11-11 23:59:00",
"cancelado": null,
"criado_em": "2022-11-10 10:30:15",
"convite": null
}
}
Received response:
Request failed with error:
Cancelar visitante
Endpoint que deleta um visitante.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://api.portaldocliente.aster.com.br/v1/visitantes/9',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
"https://api.portaldocliente.aster.com.br/v1/visitantes/9" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/visitantes/9"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
{
"code": 200,
"message": "Visitante cancelado com sucesso!",
"data": {
"id": 1,
"conta_id": 1,
"unidade_id": 1,
"id_integracao": null,
"nome": "João",
"cpf": "12345678910",
"documento": null,
"celular": "33999999999",
"foto": null,
"data_entrada": "2022-11-11 00:00:00",
"data_saida": "2022-11-11 23:59:00",
"cancelado": null,
"criado_em": "2022-11-10 10:30:15",
"convite": null
}
}
Received response:
Request failed with error:
Editar visitante
Endpoint que edita um visitante.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://api.portaldocliente.aster.com.br/v1/visitantes/292325',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'unidade_id' => 265.8,
'data_entrada' => '2021-01-02 22:00:00',
'data_saida' => '2021-01-02 22:00:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
"https://api.portaldocliente.aster.com.br/v1/visitantes/292325" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"unidade_id\": 265.8,
\"data_entrada\": \"2021-01-02 22:00:00\",
\"data_saida\": \"2021-01-02 22:00:00\"
}"
const url = new URL(
"https://api.portaldocliente.aster.com.br/v1/visitantes/292325"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"unidade_id": 265.8,
"data_entrada": "2021-01-02 22:00:00",
"data_saida": "2021-01-02 22:00:00"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"code": 200,
"message": "Visitante atualizado com sucesso!",
"data": {
"id": 1,
"conta_id": 1,
"unidade_id": 1,
"id_integracao": null,
"nome": "João",
"cpf": "12345678910",
"documento": null,
"celular": "33999999999",
"foto": null,
"data_entrada": "2022-11-11 00:00:00",
"data_saida": "2022-11-11 23:59:00",
"cancelado": null,
"criado_em": "2022-11-10 10:30:15",
"convite": null
}
}
Received response:
Request failed with error: