curl --request GET \
--url https://api.weve.cx/v1/certificates/{code}import requests
url = "https://api.weve.cx/v1/certificates/{code}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.weve.cx/v1/certificates/{code}', 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.weve.cx/v1/certificates/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.weve.cx/v1/certificates/{code}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.weve.cx/v1/certificates/{code}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weve.cx/v1/certificates/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"code": "<string>",
"code_formatted": "<string>",
"course_title": "<string>",
"club_name": "<string>",
"lesson_count": 123,
"issued_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"revoked": true,
"holder_removed": true,
"student_name": "<string>",
"club_slug": "<string>",
"hours": 123,
"revoked_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Verificar um certificado
A rota anônima que responde se um certificado é verdadeiro.
curl --request GET \
--url https://api.weve.cx/v1/certificates/{code}import requests
url = "https://api.weve.cx/v1/certificates/{code}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.weve.cx/v1/certificates/{code}', 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.weve.cx/v1/certificates/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.weve.cx/v1/certificates/{code}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.weve.cx/v1/certificates/{code}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.weve.cx/v1/certificates/{code}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"code": "<string>",
"code_formatted": "<string>",
"course_title": "<string>",
"club_name": "<string>",
"lesson_count": 123,
"issued_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"revoked": true,
"holder_removed": true,
"student_name": "<string>",
"club_slug": "<string>",
"hours": 123,
"revoked_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}revoked: true, e não 404: quem confere precisa da
diferença entre “não existe” e “foi cancelado”. Titular removido do club responde 200 com
holder_removed: true e sem o nome.
curl https://api.weve.cx/v1/certificates/4K7P-2QX9-8MHT
Path Parameters
O código do certificado, como está impresso (em grupos de quatro) ou corrido, em maiúsculas ou minúsculas.
8 - 40Response
O certificado
O que a página pública mostra a quem confere um código. Não traz id de aluno, de curso nem e-mail: quem verifica precisa saber se o documento é verdadeiro, e nada além disso.
Certificado revogado responde 200 com este campo verdadeiro, e não 404: quem confere precisa da diferença entre "não existe" e "foi cancelado".
O titular pediu para ser removido do club. O certificado continua existindo como fato, e o nome não é mais mostrado — esta página não pode anular uma remoção.
Nulo quando o titular foi removido do club.
O subdomínio do club, para a página se vestir com a marca dele.