Definição da API - Pública (v1)
Introdução
Neste artigo você poderá encontrar a estrutura da API Pública da sua plataforma.
A API utiliza arquitetura RESTfull (representational state transfer).
Endpoints
Os endpoints da API pública utilizam o EAD_ID, que pode ser encontrado na página API.
Para plataformas dominio final .mindz.com.br o endpoint base é: https://<EAD_ID>.mindz.com.br/api/public/v1, para plataformas dominio final .mindz.com.br o endpoint base é: https://<EAD_ID>.mindz.com.br/api/public/v1
Esta API pública v1 possui 5 endpoints:
Contato
https://EAD_ID.mindz.com.br/api/public/v1/contact/
Newsletter
https://EAD_ID.mindz.com.br/api/public/v1/newsletter/
Produtos
https://EAD_ID.mindz.com.br/api/public/v1/products/
Depoimentos
https://EAD_ID.mindz.com.br/api/public/v1/statements/
Estatísticas
https://EAD_ID.mindz.com.br/api/public/v1/stats/
Informações do site de vendas
https://EAD_ID.mindz.com.br/api/public/v1/site-identity/
Contato
Criar contato
POST /api/public/v1/contact/
Parâmetros:
name (obrigatório): string (max 250 chars)
email (obrigatório): string (max 250 chars)
subject (opcional): string (‘Comercial’, ‘Suporte’, ‘ Denúncia’ ou ‘Bugs e falhas’)
message (obrigatório): string
Exemplo de requisição:
curl -X 'POST' \
/api/public/v1/contact/' \
-H 'Content-Type: application/json' \
-d '{
"name": "João Teste",
"email": "teste@example.com",
"message": "Quero saber mais sobre o curso!"
}'
Exemplo de resposta:
{
"success": true
}
Newsletter
Cadastrar e-mail
POST /api/public/v1/newsletter/
Parâmetros:
email (obrigatório): string (max 250 chars)
email_list_code (opcional): string (max 15 chars)
first_name (opcional): string (max 30 chars)
last_name (opcional): string (max 30 chars)
Exemplo de requisição:
curl -X 'POST' \
'/api/public/v1/newsletter/' \
-H 'Content-Type: application/json' \
-d '{
"email": "user@example.com"
}'
Exemplo de resposta:
{
"success": true,
"message": "Contato cadastrado com sucesso"
}
Produto
Listar produtos
GET /api/public/v1/products/
Parâmetros:
limit (opcional): integer
offset (opcional): integer
ordering (opcional): string (‘name’, ‘price’, ‘score’)
product_type (opcional): string (‘bundle’, ‘course’, ‘plan’)
search (opcional): string
Exemplo de requisição:
curl -X 'GET' \
'/api/public/v1/products/' \
-H 'accept: application/json'
Exemplo de resposta:
{
"count": 12,
"next": "https://<EAD_ID>.mindz.com.br/api/public/v1/products/?limit=10&offset=10",
"previous": null,
"results": [
{
"product_type": "course",
"slug": "7qwzjmedqk",
"name": "Product Name",
"image": "image_url.jpg",
"video_uri": null,
"video_cover": null,
"price": 300,
"price_with_discount": 300,
"number_of_installments": 12,
"installment_interest": 1.9,
"installments": [
{
"number_of_installments": 1,
"value": 300
},
{
"number_of_installments": 2,
"value": 152.85
},
{
"number_of_installments": 3,
"value": 103.8
},
{
"number_of_installments": 4,
"value": 79.28
},
{
"number_of_installments": 5,
"value": 64.56
},
{
"number_of_installments": 6,
"value": 54.75
},
{
"number_of_installments": 7,
"value": 47.74
},
{
"number_of_installments": 8,
"value": 42.49
},
{
"number_of_installments": 9,
"value": 38.4
},
{
"number_of_installments": 10,
"value": 35.13
},
{
"number_of_installments": 11,
"value": 32.45
},
{
"number_of_installments": 12,
"value": 30.22
}
],
"score": 4.2,
"teachers_name": "Teacher Name",
"links": [
{
"rel": "self",
"href": "/api/public/v1/products/courses/7qwzjmedqk/"
}
],
"show_score": true,
"enrol_page": "https://<EAD_ID>.mindz.com.br/cursos/course-name/",
"checkout_page": "https://<EAD_ID>.mindz.com.br/ead/enroll/course-name/"
},
…
]
}
Listar produtos por tipo
GET /api/public/v1/products/<tipo_produto>/
Parâmetros:
limit (opcional): integer
offset (opcional): integer
ordering (opcional): string (‘name’, ‘price’, ‘score’)
search (opcional): string
Exemplo de requisição:
curl -X 'GET' \
'/api/public/v1/products/bundles/' \
-H 'accept: application/json'
Exemplo de resposta:
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"product_type": "bundle",
"slug": "wprnyeefbg",
"name": "Pacote de cursos bom",
"image": "image_url.jpg”,
"video_uri": null,
"video_cover": null,
"price": 800,
"price_with_discount": 800,
"number_of_installments": 8,
"installment_interest": 1.9,
"installments": [
{
"number_of_installments": 1,
"value": 800
},
{
"number_of_installments": 2,
"value": 407.6
},
{
"number_of_installments": 3,
"value": 276.8
},
{
"number_of_installments": 4,
"value": 211.4
},
{
"number_of_installments": 5,
"value": 172.16
},
{
"number_of_installments": 6,
"value": 146
},
{
"number_of_installments": 7,
"value": 127.31
},
{
"number_of_installments": 8,
"value": 113.3
}
],
"score": 0,
"teachers_name": "Teacher 1, Teacher 2, Teacher 3",
"links": [
{
"rel": "self",
"href": "/api/public/v1/products/bundles/wprnyeefbg/"
}
],
"show_score": null
},
…
]
}
Detalhar produto
GET /api/public/v1/products/<tipo_produto>/<slug>/
Parâmetros:
Exemplo de requisição:
curl -X 'GET' \
'/api/public/v1/products/courses/course_slug/' \
-H 'accept: application/json'
Exemplo de resposta:
{
"product_type": "course",
"slug": "course_slug",
"name": "Course Name",
"image": "url_image.png",
"video_uri": null,
"video_cover": null,
"price": 5000.24,
"price_with_discount": 3000.24,
"number_of_installments": 12,
"installment_interest": 1.9,
"installments": [
{
"number_of_installments": 1,
"value": 3000.24
},
{
"number_of_installments": 2,
"value": 1528.62
},
{
"number_of_installments": 3,
"value": 1038.08
},
{
"number_of_installments": 4,
"value": 792.81
},
{
"number_of_installments": 5,
"value": 645.65
},
{
"number_of_installments": 6,
"value": 547.54
},
{
"number_of_installments": 7,
"value": 477.47
},
{
"number_of_installments": 8,
"value": 424.91
},
{
"number_of_installments": 9,
"value": 384.03
},
{
"number_of_installments": 10,
"value": 351.33
},
{
"number_of_installments": 11,
"value": 324.57
},
{
"number_of_installments": 12,
"value": 302.27
}
],
"score": 0,
"teachers_name": "João Carlos, José Silva",
"links": {
"self": "/api/public/v1/products/courses/course_slug/",
"scores": "/api/public/v1/products/courses/course_slug/scores/"
},
"show_score": true,
"description": null,
"short_description": null,
"syllabus": null,
"faq_active": true,
"faq_base_questions": true,
"faq": [],
"features_icon_permanent_access": true,
"features_icon_questions": true,
"features_icon_certificate": true,
"features_icon_pratical_certificate": false,
"features_icon_exercises": true,
"score_summary": {
"1": 0,
"2": 0,
"3": 0,
"4": 0,
"5": 0,
"count": 0,
"rating": 0
},
"teachers": [
{
"full_name": "João Carlos",
"first_name": "João",
"last_name": "Carlos",
"profile": {
"avatar": null,
"bio": null,
"facebook": null,
"instagram": null,
"twitter": null,
"linkedin": null,
"github": null,
"youtube": null
}
},
{
"full_name": "José Silva",
"first_name": "Silva",
"last_name": "Silva",
"profile": {
"avatar": null,
"bio": null,
"facebook": null,
"instagram": null,
"twitter": null,
"linkedin": null,
"github": null,
"youtube": null
}
}
],
"last_5_comments": [
[
{
"score": 5,
"comment": "Avaliação com comentário do aluno.",
"helpful": 0,
"created": "2023-05-22T18:18:24.918999-03:00",
"user": {
"full_name": "Luan Silva",
"first_name": "Luan",
"last_name": "Silva",
"profile": {
"avatar": “url_avatar_img.png”
}
}
},
…
]
}
Listar avaliações do curso
GET /api/public/v1/products/courses/<slug>/scores
Parâmetros:
Exemplo de requisição:
curl -X 'GET' \
'/api/public/v1/products/courses/course_slug/scores' \
-H 'accept: application/json'
Exemplo de resposta:
{
"count": 5,
"next": null,
"previous": null,
"results": [
{
"score": 5,
"comment": "Avaliação com comentário do aluno.",
"helpful": 0,
"created": "2023-05-22T18:18:24.918999-03:00",
"user": {
"full_name": "Luan Silva",
"first_name": "Luan",
"last_name": "Silva",
"profile": {
"avatar": null
}
}
},
…
]
}
Depoimentos
Listar depoimentos
GET /api/public/v1/statements/
Parâmetros:
limit (opcional): integer
offset (opcional): integer
Exemplo de requisição:
curl -X 'GET' \
'/api/public/v1/statements/' \
-H 'accept: application/json'
Exemplo de resposta:
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"name": "Test",
"company": "empresa",
"job": "cargo",
"image": "image_url.jpg",
"statement": "Depoimento foda"
}
]
}
Estatísticas
Detalhar estatísticas da plataforma
GET /api/public/v1/stats/
Parâmetros:
Exemplo de requisição:
curl -X 'GET' \
'/api/public/v1/stats/' \
-H 'accept: application/json'
Exemplo de resposta:
{
"full_hours_count": 5.26,
"classes_count": 5,
"questions_answered_count": 16,
"students_count": 1854
}
Informações do site de vendas
Parâmetros:
Exemplo de requisição:
curl -X 'GET' '/api/public/v1/site-identity/' -H 'accept: application/json'
Exemplo de resposta:
{
"title": "Minha empresa",
"description": null,
"company": "Minha empresa",
"email": "naoresponda@teste.com",
"copyright_year": 2020,
"cnpj": "12.345.678/0001-00",
"terms": null,
"terms_url": "https://www.meustermos.com",
"contact": "contato@teste.com",
"logo": "https://cdn.mindz.com.br/...",
"inverse_logo": null,
"footer_logo": "https://cdn.mindz.com.br/...",
"email_logo": "https://cdn.mindz.com.br/...",
"favicon": "https://cdn.mindz.com.br/...",
"facebook": "https://www.facebook.com/",
"instagram": "https://www.instagram.com//",
"twitter": "https://twitter.com/",
"linkedin": "https://www.linkedin.com/",
"github": "https://github.com/",
"youtube": "https://www.youtube.com/",
"behance": "https://www.behance.net/",
"template": "default",
"theme_color": "yellow",
"header": null,
"subheader": null,
"background_img_header": null,
"filter_category": false,
"show_carousel": true,
"show_courses": false,
"show_resources_count": true,
"show_features": true,
"features_icon_video": true,
"features_icon_permanent_access": true,
"features_icon_questions": true,
"features_icon_certificate": true,
"features_icon_exercises": true,
"features_icon_watch_anywhere": false
}
Atualizado em: 27/02/2024
Obrigado!