Reembolsos
Reordenar as perguntas do quiz de reembolso
Define a ordem das perguntas do quiz. A lista precisa conter exatamente as perguntas do produto, cada uma uma vez; qualquer outra lista é recusada com 400.
PUT
/
v1
/
products
/
{productId}
/
refund-quiz
/
questions
/
order
Reordenar as perguntas do quiz de reembolso
curl --request PUT \
--url https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orderedIds": [
"clxq1a2b30001qz0a9b8c7d6e"
]
}
'import requests
url = "https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order"
payload = { "orderedIds": ["clxq1a2b30001qz0a9b8c7d6e"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({orderedIds: ['clxq1a2b30001qz0a9b8c7d6e']})
};
fetch('https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order', 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.ephra.io/v1/products/{productId}/refund-quiz/questions/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'orderedIds' => [
'clxq1a2b30001qz0a9b8c7d6e'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order"
payload := strings.NewReader("{\n \"orderedIds\": [\n \"clxq1a2b30001qz0a9b8c7d6e\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orderedIds\": [\n \"clxq1a2b30001qz0a9b8c7d6e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderedIds\": [\n \"clxq1a2b30001qz0a9b8c7d6e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"questions": [
{
"id": "clxq1a2b30001qz0a9b8c7d6e",
"type": "multiple_choice",
"title": "Por que você quer o reembolso?",
"description": null,
"options": [
{
"value": "expectativa",
"label": "Não era o que eu esperava"
},
{
"value": "tempo",
"label": "Não tenho tempo para o curso"
}
],
"required": true,
"active": true,
"order": 0
}
]
}
}{
"success": false,
"message": "Não foi possível concluir: uma regra de negócio recusou os dados enviados."
}{
"success": false,
"message": "Token inválido ou expirado"
}{
"success": false,
"message": "Recurso não encontrado"
}{
"success": false,
"message": "name: Nome é obrigatório"
}{
"success": false,
"message": "Muitas requisições. Tente novamente em breve."
}{
"success": false,
"message": "Erro interno do servidor"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identificador do produto.
Minimum string length:
1Body
application/json
Minimum array length:
1Pattern:
^[cC][^\s-]{8,}$⌘I
Reordenar as perguntas do quiz de reembolso
curl --request PUT \
--url https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orderedIds": [
"clxq1a2b30001qz0a9b8c7d6e"
]
}
'import requests
url = "https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order"
payload = { "orderedIds": ["clxq1a2b30001qz0a9b8c7d6e"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({orderedIds: ['clxq1a2b30001qz0a9b8c7d6e']})
};
fetch('https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order', 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.ephra.io/v1/products/{productId}/refund-quiz/questions/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'orderedIds' => [
'clxq1a2b30001qz0a9b8c7d6e'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order"
payload := strings.NewReader("{\n \"orderedIds\": [\n \"clxq1a2b30001qz0a9b8c7d6e\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orderedIds\": [\n \"clxq1a2b30001qz0a9b8c7d6e\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ephra.io/v1/products/{productId}/refund-quiz/questions/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderedIds\": [\n \"clxq1a2b30001qz0a9b8c7d6e\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"questions": [
{
"id": "clxq1a2b30001qz0a9b8c7d6e",
"type": "multiple_choice",
"title": "Por que você quer o reembolso?",
"description": null,
"options": [
{
"value": "expectativa",
"label": "Não era o que eu esperava"
},
{
"value": "tempo",
"label": "Não tenho tempo para o curso"
}
],
"required": true,
"active": true,
"order": 0
}
]
}
}{
"success": false,
"message": "Não foi possível concluir: uma regra de negócio recusou os dados enviados."
}{
"success": false,
"message": "Token inválido ou expirado"
}{
"success": false,
"message": "Recurso não encontrado"
}{
"success": false,
"message": "name: Nome é obrigatório"
}{
"success": false,
"message": "Muitas requisições. Tente novamente em breve."
}{
"success": false,
"message": "Erro interno do servidor"
}