Refresh Social Selling media access
curl --request POST \
--url https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh \
--header 'x-api-key: <api-key>'import requests
url = "https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh', 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://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "<string>",
"data": {
"asset": {
"assetId": "<string>",
"position": 123,
"origin": "POST",
"type": "IMAGE",
"mimeType": "<string>",
"width": 123,
"height": 123,
"sizeBytes": 123,
"durationMs": 123,
"pageCount": 123,
"title": "<string>",
"description": "<string>",
"altText": "<string>",
"altTextSource": "AUTHOR",
"linkUrl": "<string>",
"pollOptions": [
"<string>"
],
"transcript": {
"status": "NOT_COLLECTED"
},
"access": {
"status": "AVAILABLE",
"downloadUrl": "<string>",
"previewUrl": "<string>",
"expiresAt": "<string>",
"durable": true,
"refreshable": true,
"verifiedAt": "<string>",
"reason": "<string>"
},
"source": {
"trackedPostId": 123,
"position": 123,
"credit": "<string>"
}
},
"outcome": "ALREADY_DURABLE"
}
}Social Selling
Refresh Social Selling media access
Makes a media asset’s download URL durable: a LinkedIn URL that is still valid is copied to Enginy’s storage and the post points at the copy (COPIED); an expired one starts a LinkedIn re-read of the author’s posts (POST_REFRESH_REQUESTED, call again in a few minutes); a durable URL or an upload is re-verified (ALREADY_DURABLE). Access is re-checked on every call. Side effects: may store a copy of the file and update the post’s stored media URL.
Required scope:
SOCIAL_SELLING_WRITERate limit: 30 requests per minute
POST
/
v1
/
social-selling
/
media
/
{assetId}
/
refresh
Refresh Social Selling media access
curl --request POST \
--url https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh \
--header 'x-api-key: <api-key>'import requests
url = "https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh', 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://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.enginy.ai/v1/social-selling/media/{assetId}/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "<string>",
"data": {
"asset": {
"assetId": "<string>",
"position": 123,
"origin": "POST",
"type": "IMAGE",
"mimeType": "<string>",
"width": 123,
"height": 123,
"sizeBytes": 123,
"durationMs": 123,
"pageCount": 123,
"title": "<string>",
"description": "<string>",
"altText": "<string>",
"altTextSource": "AUTHOR",
"linkUrl": "<string>",
"pollOptions": [
"<string>"
],
"transcript": {
"status": "NOT_COLLECTED"
},
"access": {
"status": "AVAILABLE",
"downloadUrl": "<string>",
"previewUrl": "<string>",
"expiresAt": "<string>",
"durable": true,
"refreshable": true,
"verifiedAt": "<string>",
"reason": "<string>"
},
"source": {
"trackedPostId": 123,
"position": 123,
"credit": "<string>"
}
},
"outcome": "ALREADY_DURABLE"
}
}Authorizations
Path Parameters
Media asset id: spm_<postId>_<position> for a tracked post’s media (spm_<postId>_r<position> for the media of the post it reposts), ssa_<uuid> for an upload. Stable; never a URL.
Required string length:
1 - 64Example:
"spm_50307_0"