### Start media upload session with Go Source: https://docs.woopsocial.com/api-reference/media/start-media-upload-session Use this Go example to start a media upload session using the net/http package. It sends a POST request with the project ID and file size in bytes, and prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/media/upload-sessions" payload := strings.NewReader("{\n \"projectId\": \"\",\n \"fileSizeInBytes\": 2684354560\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") 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)) } ``` -------------------------------- ### Start media upload session with Python requests Source: https://docs.woopsocial.com/api-reference/media/start-media-upload-session Use this Python example to start a media upload session using the requests library. It sends a POST request with the project ID and file size in bytes, and prints the response text. ```python import requests url = "https://api.woopsocial.com/v1/media/upload-sessions" payload = { "projectId": "", "fileSizeInBytes": 2684354560 } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.text) ``` -------------------------------- ### Start media upload session with JavaScript fetch Source: https://docs.woopsocial.com/api-reference/media/start-media-upload-session Use this JavaScript example to start a media upload session using the fetch API. It sends a POST request with the project ID and file size in bytes, and logs the response or error. ```javascript const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: JSON.stringify({projectId: '', fileSizeInBytes: 2684354560}) }; fetch('https://api.woopsocial.com/v1/media/upload-sessions', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Start media upload session with Ruby Net::HTTP Source: https://docs.woopsocial.com/api-reference/media/start-media-upload-session Use this Ruby example to start a media upload session using Net::HTTP. It sends a POST request with the project ID and file size in bytes, and prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/media/upload-sessions") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"projectId\": \"\",\n \"fileSizeInBytes\": 2684354560\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### Start media upload session with PHP cURL Source: https://docs.woopsocial.com/api-reference/media/start-media-upload-session Use this PHP example to start a media upload session using cURL. It sends a POST request with the project ID and file size in bytes, and prints the response or an error message. ```php "https://api.woopsocial.com/v1/media/upload-sessions", 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([ 'projectId' => '', 'fileSizeInBytes' => 2684354560 ]), CURLOPT_HTTPHEADER => [ "Authorization: Bearer ", "Content-Type: application/json" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### Start media upload session with Java Unirest Source: https://docs.woopsocial.com/api-reference/media/start-media-upload-session Use this Java example to start a media upload session using the Unirest HTTP library. It sends a POST request with the project ID and file size in bytes, and returns the response as a string. ```java HttpResponse response = Unirest.post("https://api.woopsocial.com/v1/media/upload-sessions") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"projectId\": \"\",\n \"fileSizeInBytes\": 2684354560\n}") .asString(); ``` -------------------------------- ### List projects - client examples Source: https://docs.woopsocial.com/api-reference/projects/list-projects?playground=open These are the client examples for the List projects endpoint. Each example sends a GET request to https://api.woopsocial.com/v1/projects with the Authorization header set to 'Bearer '. The token is required and must be replaced with a valid auth token. ```bash curl --request GET \ --url https://api.woopsocial.com/v1/projects \ --header 'Authorization: Bearer ' ``` ```python import requests url = "https://api.woopsocial.com/v1/projects" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://api.woopsocial.com/v1/projects', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://api.woopsocial.com/v1/projects", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/projects" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` ```java HttpResponse response = Unirest.get("https://api.woopsocial.com/v1/projects") .header("Authorization", "Bearer ") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/projects") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Go example to list social account posts Source: https://docs.woopsocial.com/api-reference/posts/list-social-account-posts Uses net/http to GET the social account posts endpoint with a Bearer token. Prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/social-account-posts?limit=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### 200 response example Source: https://docs.woopsocial.com/api-reference/social-accounts/get-platform-specific-input-options Example 200 response body for the GET platform-inputs endpoint. Shows the structure with socialAccountId and platformSpecificInputs containing platform and boards. ```json { "socialAccountId": "", "platformSpecificInputs": { "platform": "PINTEREST", "boards": [ { "id": "", "name": "" } ] } } ``` -------------------------------- ### Ruby example to list social account posts Source: https://docs.woopsocial.com/api-reference/posts/list-social-account-posts Uses net/http to GET the social account posts endpoint with a Bearer token. Prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/social-account-posts?limit=50") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Go request to get platform-specific input options Source: https://docs.woopsocial.com/api-reference/social-accounts/get-platform-specific-input-options Uses the standard `net/http` package to send a GET request with a Bearer token and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### List media with Go Source: https://docs.woopsocial.com/api-reference/media/list-media Uses the net/http package to send a GET request and prints the response body. ```Go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/media?limit=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Response 201: Project created Source: https://docs.woopsocial.com/api-reference/projects/create-project Example success response with the created project's id and name. ```json { "id": "", "name": "" } ``` -------------------------------- ### Start media upload session with cURL Source: https://docs.woopsocial.com/api-reference/media/start-media-upload-session Use this cURL command to start a media upload session. It sends a POST request to the /v1/media/upload-sessions endpoint with the project ID and file size in bytes. The response includes the upload session ID, part size, part count, expiration time, and upload URLs for each part. ```bash curl --request POST \ --url https://api.woopsocial.com/v1/media/upload-sessions \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data ' { "projectId": "", "fileSizeInBytes": 2684354560 } ' ``` -------------------------------- ### Successful 200 response for start media upload session Source: https://docs.woopsocial.com/api-reference/media/start-media-upload-session Example of a successful 200 response from the start media upload session endpoint. It includes the upload session ID, part size, part count, expiration time, and an array of parts with their upload URLs. ```json { "uploadSessionId": "", "partSizeInBytes": 123, "partCount": 123, "expiresAt": "2023-11-07T05:31:56Z", "parts": [ { "partNumber": 2, "uploadUrl": "" } ] } ``` -------------------------------- ### Python requests example to list social account posts Source: https://docs.woopsocial.com/api-reference/posts/list-social-account-posts Uses the requests library to GET the social account posts endpoint with a Bearer token. Prints the response text. ```python import requests url = "https://api.woopsocial.com/v1/social-account-posts?limit=50" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### JavaScript fetch example to list social account posts Source: https://docs.woopsocial.com/api-reference/posts/list-social-account-posts Uses fetch to GET the social account posts endpoint with a Bearer token. Logs the JSON response or error. ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://api.woopsocial.com/v1/social-account-posts?limit=50', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Go HTTP request to list projects Source: https://docs.woopsocial.com/api-reference/projects/list-projects Uses net/http to GET /v1/projects with a Bearer token and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/projects" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Ruby request to get platform-specific input options Source: https://docs.woopsocial.com/api-reference/social-accounts/get-platform-specific-input-options Uses the `net/http` library to send a GET request with a Bearer token and prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Success response for list projects Source: https://docs.woopsocial.com/api-reference/projects/list-projects Example 200 response body: a JSON array of project objects with id and name fields. ```json [ { "id": "", "name": "" } ] ``` -------------------------------- ### Python request to get platform-specific input options Source: https://docs.woopsocial.com/api-reference/social-accounts/get-platform-specific-input-options Uses the `requests` library to perform a GET request. Prints the response text. ```python import requests url = "https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### GET /v1/media Source: https://docs.woopsocial.com/api-reference/media/list-media Fetches a list of media items with optional pagination. ```APIDOC ## [GET] /v1/media ### Description Retrieves a list of media items associated with the authenticated project. ### Method GET ### Endpoint /v1/media ### Parameters #### Query Parameters - **limit** (integer) - Optional - Maximum number of media items to return. Default may apply. ### Request Example ``` curl --request GET \ --url 'https://api.woopsocial.com/v1/media?limit=50' \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **media** (array) - List of media objects. - **id** (string) - Unique identifier of the media. - **projectId** (string) - Identifier of the project. - **mediaType** (string) - Type of media (e.g., IMAGE). - **url** (string) - URL of the media. - **createdAt** (string) - Timestamp when the media was created. - **nextCursor** (string) - Cursor for the next page of results. #### Response Example ```json { "media": [ { "id": "", "projectId": "", "mediaType": "IMAGE", "url": "", "createdAt": "2023-11-07T05:31:56Z" } ], "nextCursor": "" } ``` #### Error Response (429) - **code** (string) - Error code, e.g., TOO_MANY_CONCURRENT_REQUESTS. - **message** (string) - Error message. #### Error Response Example ```json { "code": "TOO_MANY_CONCURRENT_REQUESTS", "message": "" } ``` ``` -------------------------------- ### Get platform-specific input options (cURL, Python, JavaScript, PHP, Go, Java, Ruby) Source: https://docs.woopsocial.com/api-reference/social-accounts/get-platform-specific-input-options GET request to retrieve platform-specific input options for a social account. Requires a valid bearer token and the socialAccountId path parameter. The response contains the platform-specific inputs, such as Pinterest boards. ```bash curl --request GET \ --url https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs \ --header 'Authorization: Bearer ' ``` ```python import requests url = "https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` ```java HttpResponse response = Unirest.get("https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs") .header("Authorization", "Bearer ") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Success Response: 200 Source: https://docs.woopsocial.com/api-reference/social-accounts/generate-oauth-url Example of a successful response containing the generated OAuth URL. ```json { "url": "" } ``` -------------------------------- ### List media with Ruby Net::HTTP Source: https://docs.woopsocial.com/api-reference/media/list-media Uses Net::HTTP to send a GET request with SSL and prints the response body. ```Ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/media?limit=50") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### GET /v1/projects Source: https://docs.woopsocial.com/api-reference/projects/list-projects Lists all projects available to the authenticated user. Returns an array of project objects with id and name fields. ```APIDOC ## GET /v1/projects ### Description Retrieves a list of projects available for media upload and post creation. ### Method GET ### Endpoint https://api.woopsocial.com/v1/projects ### Parameters #### Headers - **Authorization** (string) - Required - Bearer authentication header of the form `Bearer `, where `` is your auth token. ### Response #### Success Response (200) - **id** (string) - Required - Project identifier. - **name** (string) - Required - Human-readable project name. #### Response Example ```json [ { "id": "", "name": "" } ] ``` #### Error Response (429) - **code** (string) - Required - Error code, e.g., "TOO_MANY_CONCURRENT_REQUESTS". - **message** (string) - Required - Error message. #### Error Example ```json { "code": "TOO_MANY_CONCURRENT_REQUESTS", "message": "" } ``` ``` -------------------------------- ### List webhook endpoints with Go Source: https://docs.woopsocial.com/api-reference/webhooks/list-webhook-endpoints Uses the net/http package to send a GET request to the /v1/webhooks endpoint. Prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/webhooks" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### List media with Java Unirest Source: https://docs.woopsocial.com/api-reference/media/list-media Uses the Unirest HTTP library to send a GET request and retrieve the response as a string. ```Java HttpResponse response = Unirest.get("https://api.woopsocial.com/v1/media?limit=50") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### GET /v1/projects Source: https://docs.woopsocial.com/api-reference/projects/list-projects?playground=open Retrieves a list of projects available for media upload and post creation. Requires a bearer token for authentication. ```APIDOC ## GET /v1/projects ### Description Retrieves a list of projects available for media upload and post creation. ### Method GET ### Endpoint https://api.woopsocial.com/v1/projects ### Parameters #### Headers - **Authorization** (string) - Required - Bearer authentication header of the form `Bearer `, where `` is your auth token. ### Request Example ``` curl --request GET \ --url https://api.woopsocial.com/v1/projects \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **id** (string) - Required - Project identifier. - **name** (string) - Required - Human-readable project name. #### Response Example ``` [ { "id": "", "name": "" } ] ``` #### Error Response (429) - **code** (string) - Required - Error code, e.g., `TOO_MANY_CONCURRENT_REQUESTS`. - **message** (string) - Required - Error message. #### Error Response Example ``` { "code": "TOO_MANY_CONCURRENT_REQUESTS", "message": "" } ``` ``` -------------------------------- ### Java Unirest to list projects Source: https://docs.woopsocial.com/api-reference/projects/list-projects Uses Unirest to GET /v1/projects with a Bearer token and returns the response as a string. ```java HttpResponse response = Unirest.get("https://api.woopsocial.com/v1/projects") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### List media with Python requests Source: https://docs.woopsocial.com/api-reference/media/list-media Uses the requests library to perform a GET request to the media endpoint and prints the response text. ```Python import requests url = "https://api.woopsocial.com/v1/media?limit=50" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Go: Create project Source: https://docs.woopsocial.com/api-reference/projects/create-project Uses net/http to POST a new project. Reads and prints the response body. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/projects" payload := strings.NewReader("{\n \"name\": \"\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") 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)) } ``` -------------------------------- ### Ruby: Create project Source: https://docs.woopsocial.com/api-reference/projects/create-project Uses Net::HTTP to POST a new project. Prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/projects") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"\"\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### Java: Create project Source: https://docs.woopsocial.com/api-reference/projects/create-project Uses Unirest to POST a new project. Returns the response as a string. ```java HttpResponse response = Unirest.post("https://api.woopsocial.com/v1/projects") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"name\": \"\"\n}") .asString(); ``` -------------------------------- ### Python: Create project Source: https://docs.woopsocial.com/api-reference/projects/create-project Uses the requests library to POST a new project. The response is printed to stdout. ```python import requests url = "https://api.woopsocial.com/v1/projects" payload = { "name": "" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.text) ``` -------------------------------- ### Java Unirest example to list social account posts Source: https://docs.woopsocial.com/api-reference/posts/list-social-account-posts Uses Unirest to GET the social account posts endpoint with a Bearer token. Returns an HttpResponse. ```java HttpResponse response = Unirest.get("https://api.woopsocial.com/v1/social-account-posts?limit=50") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### JavaScript: Create project Source: https://docs.woopsocial.com/api-reference/projects/create-project Uses fetch to POST a new project. Logs the JSON response or an error. ```javascript const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: JSON.stringify({name: ''}) }; fetch('https://api.woopsocial.com/v1/projects', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### PHP cURL example to list social account posts Source: https://docs.woopsocial.com/api-reference/posts/list-social-account-posts Uses PHP cURL to GET the social account posts endpoint with a Bearer token. Prints the response or a cURL error. ```php "https://api.woopsocial.com/v1/social-account-posts?limit=50", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### JavaScript fetch request to get platform-specific input options Source: https://docs.woopsocial.com/api-reference/social-accounts/get-platform-specific-input-options Uses the Fetch API to make a GET request and logs the JSON response or error. ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Create Project Response 201 Source: https://docs.woopsocial.com/api-reference/projects/create-project Example response body for a successful project creation (HTTP 201). Contains the project id and name. ```json { "id": "", "name": "" } ``` -------------------------------- ### cURL request to get platform-specific input options Source: https://docs.woopsocial.com/api-reference/social-accounts/get-platform-specific-input-options Sends a GET request to the platform-inputs endpoint with a Bearer token. Replace `{socialAccountId}` and `` with actual values. ```bash curl --request GET \ --url https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Java Unirest request to get platform-specific input options Source: https://docs.woopsocial.com/api-reference/social-accounts/get-platform-specific-input-options Uses the Unirest HTTP library to send a GET request with a Bearer token and returns the response as a string. ```java HttpResponse response = Unirest.get("https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### PHP cURL request to get platform-specific input options Source: https://docs.woopsocial.com/api-reference/social-accounts/get-platform-specific-input-options Uses PHP cURL to send a GET request with a Bearer token. Outputs the response or a cURL error. ```php "https://api.woopsocial.com/v1/social-accounts/{socialAccountId}/platform-inputs", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### Get post with Go Source: https://docs.woopsocial.com/api-reference/posts/get-post Use this Go snippet to fetch a post using the net/http package. Replace {postId} and with your actual values. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/posts/{postId}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### media_uploads_get_session Source: https://docs.woopsocial.com/mcp/tools-reference Get media upload session status ```APIDOC ## media_uploads_get_session ### Description Get media upload session status ### Method GET ### Endpoint /media/uploads/session/{sessionId} ### Parameters #### Path Parameters - **sessionId** (string) - Required - The upload session ID. ### Response #### Success Response (200) - **status** (string) - The status of the upload session. #### Response Example { "status": "in_progress" } ``` -------------------------------- ### Create Project with Unirest (Java) Source: https://docs.woopsocial.com/api-reference/projects/create-project Sends a POST request to create a project using the Unirest HTTP library. Requires a Bearer token and a JSON body with a project name. ```java HttpResponse response = Unirest.post("https://api.woopsocial.com/v1/projects") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"name\": \"\"\n}") .asString(); ``` -------------------------------- ### POST /v1/media/upload-sessions Source: https://docs.woopsocial.com/api-reference/media/start-media-upload-session Starts a media upload session by providing the project ID and file size. Returns session details including part upload URLs. ```APIDOC ## POST /v1/media/upload-sessions ### Description Starts a media upload session by providing the project ID and the file size in bytes. Returns an upload session ID, part size, part count, expiration time, and pre-signed URLs for each part. ### Method POST ### Endpoint https://api.woopsocial.com/v1/media/upload-sessions ### Parameters #### Request Body - **projectId** (string) - Required - The ID of the project for which the media upload session is being created. - **fileSizeInBytes** (integer) - Required - The total size of the file to be uploaded, in bytes. ### Request Example ```json { "projectId": "", "fileSizeInBytes": 2684354560 } ``` ### Response #### Success Response (200) - **uploadSessionId** (string) - The unique identifier for the upload session. - **partSizeInBytes** (integer) - The size of each part in bytes. - **partCount** (integer) - The total number of parts. - **expiresAt** (string) - The expiration timestamp of the upload session. - **parts** (array) - List of parts with their part numbers and pre-signed upload URLs. - **partNumber** (integer) - The part number. - **uploadUrl** (string) - The pre-signed URL for uploading the part. #### Response Example ```json { "uploadSessionId": "", "partSizeInBytes": 123, "partCount": 123, "expiresAt": "2023-11-07T05:31:56Z", "parts": [ { "partNumber": 2, "uploadUrl": "" } ] } ``` #### Error Response (429) - **code** (string) - Error code indicating too many concurrent requests. - **message** (string) - Error message. #### Error Example ```json { "code": "TOO_MANY_CONCURRENT_REQUESTS", "message": "" } ``` ``` -------------------------------- ### media_uploads_complete_session Source: https://docs.woopsocial.com/mcp/tools-reference Completes the upload session started by `createUploadSession`. ```APIDOC ## media_uploads_complete_session ### Description Completes the upload session started by `createUploadSession`. ### Method POST ### Endpoint /media/uploads/session/{sessionId}/complete ### Parameters #### Path Parameters - **sessionId** (string) - Required - The upload session ID. ### Response #### Success Response (200) - **mediaItem** (object) - The completed media item. #### Response Example { "mediaItem": {} } ``` -------------------------------- ### Create Project with Net::HTTP (Ruby) Source: https://docs.woopsocial.com/api-reference/projects/create-project Sends a POST request to create a project using Ruby's Net::HTTP library. Requires a Bearer token and a JSON body with a project name. ```ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/projects") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"\"\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### POST /v1/projects Source: https://docs.woopsocial.com/api-reference/projects/create-project Creates a new project with the specified name. Returns the created project details. ```APIDOC ## POST /v1/projects ### Description Creates a new project with the specified name. ### Method POST ### Endpoint https://api.woopsocial.com/v1/projects ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - Human-readable project name. ### Request Example { "name": "" } ### Response #### Success Response (201) - **id** (string) - Required - Project identifier. - **name** (string) - Required - Human-readable project name. #### Response Example { "id": "", "name": "" } #### Error Response (429) - **code** (string) - Required - Error code. - **message** (string) - Required - Error message. #### Error Example { "code": "TOO_MANY_CONCURRENT_REQUESTS", "message": "" } ### Authorizations - **Authorization** (string, header) - Required - Bearer authentication header of the form `Bearer `, where `` is your auth token. ``` -------------------------------- ### Get media upload session status (cURL, Python, JavaScript, PHP, Go, Java, Ruby) Source: https://docs.woopsocial.com/api-reference/media/get-media-upload-session-status Send a GET request to the media upload session status endpoint. Replace {uploadSessionId} with the session ID and with a valid bearer token. The response is the upload session status JSON. ```bash curl --request GET \ --url https://api.woopsocial.com/v1/media/upload-sessions/{uploadSessionId} \ --header 'Authorization: Bearer ' ``` ```python import requests url = "https://api.woopsocial.com/v1/media/upload-sessions/{uploadSessionId}" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://api.woopsocial.com/v1/media/upload-sessions/{uploadSessionId}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://api.woopsocial.com/v1/media/upload-sessions/{uploadSessionId}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/media/upload-sessions/{uploadSessionId}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` ```java HttpResponse response = Unirest.get("https://api.woopsocial.com/v1/media/upload-sessions/{uploadSessionId}") .header("Authorization", "Bearer ") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/media/upload-sessions/{uploadSessionId}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Go: Upload media Source: https://docs.woopsocial.com/api-reference/media/upload-media?playground=open Uploads a file using the net/http package. The payload is a multipart/form-data string. Replace and with your credentials and file content. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/media" payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Delete project with Go Source: https://docs.woopsocial.com/api-reference/projects/delete-project Uses the net/http package to send a DELETE request. Prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/projects/{projectId}" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### List media with cURL, Python, JavaScript, PHP, Go, Java, and Ruby Source: https://docs.woopsocial.com/api-reference/media/list-media GET request to list media with a limit of 50 items. Requires an Authorization header with a bearer token. The response is a JSON object containing a media array and a nextCursor for pagination. ```bash curl --request GET \ --url 'https://api.woopsocial.com/v1/media?limit=50' \ --header 'Authorization: Bearer ' ``` ```python import requests url = "https://api.woopsocial.com/v1/media?limit=50" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://api.woopsocial.com/v1/media?limit=50', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://api.woopsocial.com/v1/media?limit=50", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.woopsocial.com/v1/media?limit=50" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` ```java HttpResponse response = Unirest.get("https://api.woopsocial.com/v1/media?limit=50") .header("Authorization", "Bearer ") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.woopsocial.com/v1/media?limit=50") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### 200 Success Response Source: https://docs.woopsocial.com/api-reference/media/complete-media-upload-session Example of a successful response with status 200. Contains uploadSessionId and status INITIATED. ```json { "uploadSessionId": "", "status": "INITIATED" } ``` -------------------------------- ### cURL upload media example Source: https://docs.woopsocial.com/api-reference/media/upload-media?playground=open Uploads a media file using cURL with a multipart/form-data request. The file is sent in the 'file' field. Replace YOUR_PROJECT_ID and YOUR_API_KEY with your credentials. ```bash curl -X POST 'https://api.woopsocial.com/v1/media?projectId=YOUR_PROJECT_ID' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -F 'file=@/path/to/image.jpg' ```