Matricular alunos
curl --request POST \
--url https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"email": "<string>",
"starts_at": "<string>",
"expires_at": "<string>"
}
],
"source_product_id": "<string>",
"access_plan": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/"
payload = {
"items": [
{
"email": "<string>",
"starts_at": "<string>",
"expires_at": "<string>"
}
],
"source_product_id": "<string>",
"access_plan": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [{email: '<string>', starts_at: '<string>', expires_at: '<string>'}],
source_product_id: '<string>',
access_plan: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'email' => '<string>',
'starts_at' => '<string>',
'expires_at' => '<string>'
]
],
'source_product_id' => '<string>',
'access_plan' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"email\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"expires_at\": \"<string>\"\n }\n ],\n \"source_product_id\": \"<string>\",\n \"access_plan\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"email\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"expires_at\": \"<string>\"\n }\n ],\n \"source_product_id\": \"<string>\",\n \"access_plan\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"items\": [\n {\n \"email\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"expires_at\": \"<string>\"\n }\n ],\n \"source_product_id\": \"<string>\",\n \"access_plan\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"source": "csv",
"access_plan": {
"name": "<string>",
"duration_days": 123
},
"summary": {
"total": 123,
"criados": 123,
"convites": 123,
"ja_existe": 123,
"erros": 123
},
"results": "<unknown>",
"created_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}Alunos
Matricular alunos
Dá acesso à área por lista de e-mails (items) ou aos compradores de um produto seu (source_product_id), exatamente uma das duas.
POST
/
public_api
/
members
/
areas
/
{member_area_id}
/
enrollments
/
import
/
Matricular alunos
curl --request POST \
--url https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"email": "<string>",
"starts_at": "<string>",
"expires_at": "<string>"
}
],
"source_product_id": "<string>",
"access_plan": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/"
payload = {
"items": [
{
"email": "<string>",
"starts_at": "<string>",
"expires_at": "<string>"
}
],
"source_product_id": "<string>",
"access_plan": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [{email: '<string>', starts_at: '<string>', expires_at: '<string>'}],
source_product_id: '<string>',
access_plan: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'email' => '<string>',
'starts_at' => '<string>',
'expires_at' => '<string>'
]
],
'source_product_id' => '<string>',
'access_plan' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"email\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"expires_at\": \"<string>\"\n }\n ],\n \"source_product_id\": \"<string>\",\n \"access_plan\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"email\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"expires_at\": \"<string>\"\n }\n ],\n \"source_product_id\": \"<string>\",\n \"access_plan\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.cakto.com.br/public_api/members/areas/{member_area_id}/enrollments/import/");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"items\": [\n {\n \"email\": \"<string>\",\n \"starts_at\": \"<string>\",\n \"expires_at\": \"<string>\"\n }\n ],\n \"source_product_id\": \"<string>\",\n \"access_plan\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"source": "csv",
"access_plan": {
"name": "<string>",
"duration_days": 123
},
"summary": {
"total": 123,
"criados": 123,
"convites": 123,
"ja_existe": 123,
"erros": 123
},
"results": "<unknown>",
"created_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}Escopo
write members
Authorizations
Token de autenticação do tipo Bearer {access_token}, onde {access_token} é o token obtido no fluxo de autenticação.
Body
application/json
Response
Só para o schema: o summary da importação é um objeto de contagens, não texto.
Was this page helpful?