Social network sign in confirmation
curl --request POST \
--url https://api.paylora.org/api/v1/auth/social-networks/sign_in \
--header 'Content-Type: application/json' \
--data '
{
"type": "google",
"code": "4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw",
"state": "0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw"
}
'import requests
url = "https://api.paylora.org/api/v1/auth/social-networks/sign_in"
payload = {
"type": "google",
"code": "4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw",
"state": "0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'google',
code: '4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw',
state: '0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw'
})
};
fetch('https://api.paylora.org/api/v1/auth/social-networks/sign_in', 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.paylora.org/api/v1/auth/social-networks/sign_in",
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([
'type' => 'google',
'code' => '4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw',
'state' => '0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw'
]),
CURLOPT_HTTPHEADER => [
"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.paylora.org/api/v1/auth/social-networks/sign_in"
payload := strings.NewReader("{\n \"type\": \"google\",\n \"code\": \"4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\",\n \"state\": \"0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.paylora.org/api/v1/auth/social-networks/sign_in")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"google\",\n \"code\": \"4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\",\n \"state\": \"0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paylora.org/api/v1/auth/social-networks/sign_in")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"google\",\n \"code\": \"4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\",\n \"state\": \"0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"access": ""
}
}{
"statusCode": 400,
"message": [
"[value] is not valid"
]
}{
"statusCode": 401,
"message": "Invalid signature | jwt must be provided"
}{
"statusCode": 403,
"message": "Only [admin, customer] has access"
}{
"statusCode": 404,
"message": "Resource Not Found"
}{
"statusCode": 409,
"message": "Resource with unique value (email, name etc) already exist"
}{
"statusCode": 429,
"message": "Too Many Requests"
}{
"statusCode": 500,
"message": "Sever error message"
}Auth
Social network sign in confirmation
After user put code logic will check if user with email is exist return token if no create new user and send token
POST
/
api
/
v1
/
auth
/
social-networks
/
sign_in
Social network sign in confirmation
curl --request POST \
--url https://api.paylora.org/api/v1/auth/social-networks/sign_in \
--header 'Content-Type: application/json' \
--data '
{
"type": "google",
"code": "4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw",
"state": "0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw"
}
'import requests
url = "https://api.paylora.org/api/v1/auth/social-networks/sign_in"
payload = {
"type": "google",
"code": "4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw",
"state": "0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'google',
code: '4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw',
state: '0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw'
})
};
fetch('https://api.paylora.org/api/v1/auth/social-networks/sign_in', 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.paylora.org/api/v1/auth/social-networks/sign_in",
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([
'type' => 'google',
'code' => '4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw',
'state' => '0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw'
]),
CURLOPT_HTTPHEADER => [
"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.paylora.org/api/v1/auth/social-networks/sign_in"
payload := strings.NewReader("{\n \"type\": \"google\",\n \"code\": \"4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\",\n \"state\": \"0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.paylora.org/api/v1/auth/social-networks/sign_in")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"google\",\n \"code\": \"4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\",\n \"state\": \"0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paylora.org/api/v1/auth/social-networks/sign_in")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"google\",\n \"code\": \"4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\",\n \"state\": \"0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"access": ""
}
}{
"statusCode": 400,
"message": [
"[value] is not valid"
]
}{
"statusCode": 401,
"message": "Invalid signature | jwt must be provided"
}{
"statusCode": 403,
"message": "Only [admin, customer] has access"
}{
"statusCode": 404,
"message": "Resource Not Found"
}{
"statusCode": 409,
"message": "Resource with unique value (email, name etc) already exist"
}{
"statusCode": 429,
"message": "Too Many Requests"
}{
"statusCode": 500,
"message": "Sever error message"
}Body
application/json
Available options:
google, fb This code from redirected url ?code=4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw
Example:
"4/0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw"
This state from redirected url ?state=0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw
Example:
"0AWgavddtNRQ18dDzaB9Wlhm82tXC7tGVE-FfCvqaErDpVp3DZuw5895qDhuiluyBT3Zrdw"
Response
User`s logined
⌘I

