PHP (cURL)
<?php
// 1. Exchange authorization code for token
$ch = curl_init('https://www.conexaosocial.online/oauth/token');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'grant_type' => 'authorization_code',
'client_id' => 'YOUR_CLIENT_ID',
'client_secret' => 'YOUR_CLIENT_SECRET',
'redirect_uri' => 'https://yourapp.com/callback',
'code' => $_GET['code']
]);
$res = json_decode(curl_exec($ch), true);
$token = $res['access_token'];
// 2. Fetch authenticated member profile via Developer API v1
$ch = curl_init('https://www.conexaosocial.online/api/developer/v1/me/profile');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $token,
'Accept: application/json'
]);
$profile = json_decode(curl_exec($ch), true);
print_r($profile['data']);
?>
Node.js (Axios)
const axios = require('axios');
async function getProfile(code) {
// 1. Exchange code for access token
const tokenRes = await axios.post('https://www.conexaosocial.online/oauth/token', {
grant_type: 'authorization_code',
client_id: 'YOUR_CLIENT_ID',
client_secret: 'YOUR_CLIENT_SECRET',
redirect_uri: 'https://yourapp.com/callback',
code: code
});
const accessToken = tokenRes.data.access_token;
// 2. Access Developer API v1 endpoint
const profileRes = await axios.get('https://www.conexaosocial.online/api/developer/v1/me/profile', {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Accept': 'application/json'
}
});
return profileRes.data.data;
}
Python (Requests)
import requests
# 1. Exchange authorization code for token
token_res = requests.post('https://www.conexaosocial.online/oauth/token', data={
'grant_type': 'authorization_code',
'client_id': 'YOUR_CLIENT_ID',
'client_secret': 'YOUR_CLIENT_SECRET',
'redirect_uri': 'https://yourapp.com/callback',
'code': auth_code
})
access_token = token_res.json().get('access_token')
# 2. Fetch profile from Developer API v1
profile_res = requests.get('https://www.conexaosocial.online/api/developer/v1/me/profile', headers={
'Authorization': f'Bearer {access_token}',
'Accept': 'application/json'
})
print(profile_res.json().get('data'))
cURL
# 1. Exchange code for access token
curl -X POST https://www.conexaosocial.online/oauth/token \
-d "grant_type=authorization_code" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "code=AUTHORIZATION_CODE" \
-d "redirect_uri=https://yourapp.com/callback"
# 2. Call Developer API v1 with Bearer token
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Accept: application/json" \
https://www.conexaosocial.online/api/developer/v1/me/profile