Login
curl --request POST \
--url https://homolog.clubfix.com.br/webservice/auth/login \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'X-CREDENTIALS: <x-credentials>' \
--data '
{
"client_id": "{{client_id}}",
"client_secret": "{{client_secret}}"
}
'import requests
url = "https://homolog.clubfix.com.br/webservice/auth/login"
payload = {
"client_id": "{{client_id}}",
"client_secret": "{{client_secret}}"
}
headers = {
"Accept": "<accept>",
"Content-Type": "<content-type>",
"X-CREDENTIALS": "<x-credentials>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
'Content-Type': '<content-type>',
'X-CREDENTIALS': '<x-credentials>',
Authorization: 'Bearer <token>'
},
body: JSON.stringify({client_id: '{{client_id}}', client_secret: '{{client_secret}}'})
};
fetch('https://homolog.clubfix.com.br/webservice/auth/login', 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://homolog.clubfix.com.br/webservice/auth/login",
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([
'client_id' => '{{client_id}}',
'client_secret' => '{{client_secret}}'
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"X-CREDENTIALS: <x-credentials>"
],
]);
$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://homolog.clubfix.com.br/webservice/auth/login"
payload := strings.NewReader("{\n \"client_id\": \"{{client_id}}\",\n \"client_secret\": \"{{client_secret}}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-CREDENTIALS", "<x-credentials>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://homolog.clubfix.com.br/webservice/auth/login")
.header("Accept", "<accept>")
.header("Content-Type", "<content-type>")
.header("X-CREDENTIALS", "<x-credentials>")
.header("Authorization", "Bearer <token>")
.body("{\n \"client_id\": \"{{client_id}}\",\n \"client_secret\": \"{{client_secret}}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://homolog.clubfix.com.br/webservice/auth/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Content-Type"] = '<content-type>'
request["X-CREDENTIALS"] = '<x-credentials>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"client_id\": \"{{client_id}}\",\n \"client_secret\": \"{{client_secret}}\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "6|KPFUf8qNNernBuWdnxqSxFSceKPuPDQII2hqqKyi",
"token_type": "Bearer",
"expires_in": "2023-07-26 12:09:41"
}Autenticação
Autenticação
Obtém um token de acesso Bearer para utilizar os demais recursos da API
POST
/
auth
/
login
Login
curl --request POST \
--url https://homolog.clubfix.com.br/webservice/auth/login \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--header 'X-CREDENTIALS: <x-credentials>' \
--data '
{
"client_id": "{{client_id}}",
"client_secret": "{{client_secret}}"
}
'import requests
url = "https://homolog.clubfix.com.br/webservice/auth/login"
payload = {
"client_id": "{{client_id}}",
"client_secret": "{{client_secret}}"
}
headers = {
"Accept": "<accept>",
"Content-Type": "<content-type>",
"X-CREDENTIALS": "<x-credentials>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
'Content-Type': '<content-type>',
'X-CREDENTIALS': '<x-credentials>',
Authorization: 'Bearer <token>'
},
body: JSON.stringify({client_id: '{{client_id}}', client_secret: '{{client_secret}}'})
};
fetch('https://homolog.clubfix.com.br/webservice/auth/login', 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://homolog.clubfix.com.br/webservice/auth/login",
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([
'client_id' => '{{client_id}}',
'client_secret' => '{{client_secret}}'
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: <content-type>",
"X-CREDENTIALS: <x-credentials>"
],
]);
$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://homolog.clubfix.com.br/webservice/auth/login"
payload := strings.NewReader("{\n \"client_id\": \"{{client_id}}\",\n \"client_secret\": \"{{client_secret}}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-CREDENTIALS", "<x-credentials>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://homolog.clubfix.com.br/webservice/auth/login")
.header("Accept", "<accept>")
.header("Content-Type", "<content-type>")
.header("X-CREDENTIALS", "<x-credentials>")
.header("Authorization", "Bearer <token>")
.body("{\n \"client_id\": \"{{client_id}}\",\n \"client_secret\": \"{{client_secret}}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://homolog.clubfix.com.br/webservice/auth/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Content-Type"] = '<content-type>'
request["X-CREDENTIALS"] = '<x-credentials>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"client_id\": \"{{client_id}}\",\n \"client_secret\": \"{{client_secret}}\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "6|KPFUf8qNNernBuWdnxqSxFSceKPuPDQII2hqqKyi",
"token_type": "Bearer",
"expires_in": "2023-07-26 12:09:41"
}string
required
Identificador da credencial de API fornecido pelo time ClubFix. Disponível no painel de credenciais ou enviado pelo suporte ao habilitar o parceiro.
string
required
Chave secreta da credencial de API. Deve ser mantida em sigilo — nunca exposta no frontend ou em logs.
Resposta
{
"token": "eyJ0eXAiOiJKV1Q...",
"token_type": "Bearer"
}
| Campo | Tipo | Descrição |
|---|---|---|
token | string | Token JWT de acesso. Utilize no header Authorization: Bearer {token} em todas as chamadas subsequentes |
token_type | string | Tipo do token. Sempre Bearer |
O token tem validade limitada. Ao receber erro
401 Unauthorized em qualquer endpoint, renove o token chamando este endpoint novamente com as mesmas credenciais.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Was this page helpful?
