Skip to main content
POST
https://app.ocoya.com/api/_public/v1
/
social-profiles
/
connection-url
Generate social connection URL
curl --request POST \
  --url https://app.ocoya.com/api/_public/v1/social-profiles/connection-url \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "provider": "instagram"
}
'
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({provider: 'instagram'})
};

fetch('https://app.ocoya.com/api/_public/v1/social-profiles/connection-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://app.ocoya.com/api/_public/v1/social-profiles/connection-url"

payload = { "provider": "instagram" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://app.ocoya.com/api/_public/v1/social-profiles/connection-url",
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([
'provider' => 'instagram'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
require 'uri'
require 'net/http'

url = URI("https://app.ocoya.com/api/_public/v1/social-profiles/connection-url")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": \"instagram\"\n}"

response = http.request(request)
puts response.read_body
{
  "url": "https://app.ocoya.com/api/social-connect/start?provider=instagram&workspaceId=cmayvq3hk00017apshay5qezu"
}

Authorizations

X-API-Key
string
header
required

Query Parameters

workspaceId
string
required

Ocoya workspace ID. Get one from GET /workspaces.

Example:

"cmayvq3hk00017apshay5qezu"

Body

application/json
provider
enum<string>
required

Social network used for the connection flow.

Available options:
facebook,
instagram,
x,
linkedin,
pinterest
Example:

"instagram"

Response

Success

url
string
required

Browser URL to open while signed in to Ocoya to start the connection flow.

Example:

"https://app.ocoya.com/api/social-connect/start?provider=instagram&workspaceId=cmayvq3hk00017apshay5qezu"