Vincular múltiplos planos a múltiplos alunos

Route (Rota)

Método Rota Descrição
POST /webservice/plans/bind-plans-to-students Vincula um/ou mais planos a um/ou mais alunos

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

Body params (Parâmetros)

Exemplos

Param Tipo Descrição Obrigatório
plans JSON id do plano Sim
students JSON id do aluno Sim

cURL

				
					curl --location 'https://dev3.nochalks.com/webservice/plans/bind-plans-to-students' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'secret: {{._webservice_secret}}' \
--header 'token: {{._webservice_token}}' \
--data '{
  "plans": [
    1,
    2,
    3
  ],
  "students": [
    1,
    2,
    10,
    11,
    13,
    15
  ]
}'
				
			

Node.js

				
					const axios = require('axios');
let data = JSON.stringify({
  "plans": [
    1,
    2,
    3
  ],
  "students": [
    1,
    2,
    10,
    11,
    13,
    15
  ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://dev3.nochalks.com/webservice/plans/bind-plans-to-students',
  headers: { 
    'Content-Type': 'application/json', 
    'Accept': 'application/json', 
    '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 = [
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'secret' => '{{._webservice_secret}}',
  'token' => '{{._webservice_token}}'
];
$body = '{
  "plans": [
    1,
    2,
    3
  ],
  "students": [
    1,
    2,
    10,
    11,
    13,
    15
  ]
}';
$request = new Request('POST', 'https://dev3.nochalks.com/webservice/plans/bind-plans-to-students', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();



				
			

Request (Requisição)

				
					{
  "plans": [
    1,
    2,
    3
  ],
  "students": [
    1,
    2,
    10,
    11,
    13,
    15
  ]
}
				
			

Response (Respostas)

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

				
					{
  "message": "planos vinculados!"
}
				
			
ESCOLHA UM ATENDIMENTO:
Contato por Chat CHAT
Contato por E-mail E-MAIL
Contato por Telefone TELEFONE
Contato por Whatsapp WHATSAPP
Plataforma EAD para Cursos e Treinamentos Online mais segura do mercado!
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.