Link para login externo

Para login externo na sua plataforma deve-se primeiro criar o auth-token e em seguida usar o mesmo no link de login externo via Query Params 

Route (Rota)

Método Rota Descrição
POST webservice/student/{{student_id}}/create-auth-token Gera o auth-token referente ao aluno
GET webservice/authenticate/{{auth_token}} link para login

Headers (Cabeçalho)

Param Tipo Descrição Obrigatório
Accept String application/json Sim
content-type String application/json Sim
secret String *Secret Key Sim
token String **Webservice Token Sim

*Para conseguir a Secret Key acesse sua Plataforma, abra o Menu, vá na área de Usuários e acesse Webservice, lá você terá a lista de usuários com suas respectivas Secret Key

** Token gerado pela rota de autenticação

Query Params (Parâmetros)

Param Tipo Descrição Obrigatório
plan String Adicionar o id de um plano no juntamente ao criar um auth_token direciona o aluno logado diretamente para pagina do plano nao

Exemplos

cURL

				
					curl --location --globoff --request POST 'https://dev3.nochalks.com/webservice/student/{{student_id}}/create-auth-token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'secret: {{ _.webservice_secret}}' \
--header 'token: {{ _.webservice_token}}' \

				
			
				
					curl --location --globoff --request POST 'https://dev3.nochalks.com/webservice/student/{{student_id}}/create-auth-token?plan=1' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'secret: {{ _.webservice_secret}}' \
--header 'token: {{ _.webservice_token}}' \

				
			

Node.js

				
					const axios = require('axios');
let data = '';

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://dev3.nochalks.com/webservice/student/{{student_id}}/create-auth-token',
  headers: { 
    'Accept': 'application/json', 
    'Content-Type': 'application/json;charset=UTF-8', 
    'secret': '{{ _.webservice_secret}}', 
    'token': '{{ _.webservice_token}}'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

				
			
				
					const axios = require('axios');
let data = '';

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://dev3.nochalks.com/webservice/student/{{student_id}}/create-auth-token?plan=1',
  headers: { 
    'Accept': 'application/json', 
    'Content-Type': 'application/json;charset=UTF-8', 
    'secret': '{{ _.webservice_secret}}', 
    'token': '{{ _.webservice_token}}'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

				
			

PHP

				
					<?php
$client = new Client();
$headers = [
  'Accept' => 'application/json',
  'Content-Type' => 'application/json;charset=UTF-8',
  'secret' => '{{ _.webservice_secret}}',
  'token' => '{{ _.webservice_token}}'
];
$body = '';
$request = new Request('POST', 'https://dev3.nochalks.com/webservice/student/{{student_id}}/create-auth-token', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();



				
			
				
					<?php
$client = new Client();
$headers = [
  'Accept' => 'application/json',
  'Content-Type' => 'application/json;charset=UTF-8',
  'secret' => '{{ _.webservice_secret}}',
  'token' => '{{ _.webservice_token}}'
];
$body = '';
$request = new Request('POST', 'https://dev3.nochalks.com/webservice/student/{{student_id}}/create-auth-token?plan=1', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();



				
			

Response (Respostas)

- Resposta ao criar um novo aluno (Status: 200)

				
					{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwiZW1haWwiOiJhbHVub3Rlc3RlMDFAZW1haWwuY29tIiwiZXhwIjoxNjkxMDc5MzQzfQ.Ws9a-IA5RMGH9mA-wC2y4SLtlm-fc3F04XnkkMkf7AU?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwiZW1haWwiOiJqbGltYUBzb3VqbXYuY29tIiwicGFzc3dvcmQiOiIkMnkkMTAkNklXZHZrdTguU1RpbFJwUTFSNGZ0dVVvU080M0lqbmVzVHJndmdUUXNcL2VzWW1iUEtxVGVlIiwiZXhwIjoxNjkwOTI4OTcxfQ.Tun6qn-exKT93kfPV8sowbBGdGJ64sc3QVvCCnJqKz0"
}
				
			

Exemplo de link para login

- adicionar o auth_token da resposta ao link

				
					https://dev3.nochalks.com/webservica/authenticate/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwiZW1haWwiOiJhbHVub3Rlc3RlMDFAZW1haWwuY29tIiwiZXhwIjoxNjkxMDc5MzQzfQ.Ws9a-IA5RMGH9mA-wC2y4SLtlm-fc3F04XnkkMkf7AU?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MSwiZW1haWwiOiJqbGltYUBzb3VqbXYuY29tIiwicGFzc3dvcmQiOiIkMnkkMTAkNklXZHZrdTguU1RpbFJwUTFSNGZ0dVVvU080M0lqbmVzVHJndmdUUXNcL2VzWW1iUEtxVGVlIiwiZXhwIjoxNjkwOTI4OTcxfQ.Tun6qn-exKT93kfPV8sowbBGdGJ64sc3QVvCCnJqKz0
				
			
ESCOLHA UM ATENDIMENTO:
Contato por Chat CHAT
Contato por E-mail E-MAIL
Contato por Telefone TELEFONE
Contato por Whatsapp WHATSAPP