### Successful Response Example Source: https://docs.nuelink.com/guides/endpoints/get-channels This is an example of a successful `200 OK` response when listing channels. It includes channel data, status, and pagination information. ```json { "status":"success", "data":[ { "id":299664, "name":"fernwood-signups", "status":"ACTIVE", "type":"Instagram", "createdAt":"2026-04-16T10:32:53.000000Z", "updatedAt":"2026-04-16T10:32:53.000000Z" }, { "id":60111, "name":"FernwoodBotanicals", "status":"INACTIVE", "type":"X", "createdAt":"2023-08-10T11:38:53.000000Z", "updatedAt":"2026-01-06T10:55:07.000000Z" } ], "pagination":{ "currentPage":1, "perPage":10, "total":8, "lastPage":1, "nextPageUrl":null, "prevPageUrl":null } } ``` -------------------------------- ### Resource Not Found Example Source: https://docs.nuelink.com/reference/all An example of a 404 Not Found response, such as when a referenced channel does not belong to the authenticated brand. ```APIDOC ### Resource-not-found example When a channel referenced inside a YouTube playlist doesn’t belong to the brand: **Response: 404 Not Found:** ```json { "status": "error", "message": "Channel not found or does not belong to the brand", "errors": { "platforms.youtube.playlists.0.channelId": "Channel not found or does not belong to the brand" } } ``` ``` -------------------------------- ### API Response Example Source: https://docs.nuelink.com/guides/endpoints/post-posts This is an example of a successful response when a post is created. It indicates a '201 Created' status with a success message and the new post's ID. ```json { "status": "success", "data": { "id": 4364709, "message": "Post created successfully" } } ``` -------------------------------- ### Media Array Example Source: https://docs.nuelink.com/guides/endpoints/post-posts Illustrates the structure for the 'media' array, which accepts either an 'id' from a previous media upload or a direct public 'url'. ```json "media": [ { "id": "bWVkaWEvWThQT0NxWWFRcEtIRXZYMW16U0hsZFRnN0hFdEpYVzIubXA0" }, { "url": "https://example.com/hero.jpg" } ] ``` -------------------------------- ### Example Validation Errors Source: https://docs.nuelink.com/guides/endpoints/post-media These examples demonstrate common validation errors that can occur during media uploads, including missing files, exceeding size limits, and unsupported formats. ```json { "status": "error", "message": "The given data was invalid.", "errors": { "media": ["The media field is required."] } } ``` ```json { "status": "error", "message": "The given data was invalid.", "errors": { "media": ["The media file may not be greater than 100 megabytes."] } } ``` ```json { "status": "error", "message": "The given data was invalid.", "errors": { "media": ["The media must be a file of type: png, jpg, jpeg, mp4, mov, pdf."] } } ``` -------------------------------- ### Create Post with All Options Source: https://docs.nuelink.com/reference/all This comprehensive example demonstrates creating a post with a wide range of options, including title, caption, media, scheduling, stories, comments, and platform-specific configurations. ```APIDOC ## POST /api/public/v1/brands/{brandId}/collections/{collectionId}/posts ### Description Creates a new post utilizing all available options, including detailed content, scheduling, media attachments, comments, and platform-specific settings for Instagram, Facebook, TikTok, and YouTube. ### Method POST ### Endpoint /api/public/v1/brands/{brandId}/collections/{collectionId}/posts ### Parameters #### Request Body - **title** (string) - Optional - The title of the post. - **caption** (string) - Optional - The main text content of the post. - **alt** (string) - Optional - Alternative text for the media. - **link** (string) - Optional - A URL to include in the post. - **publishMode** (string) - Optional - Mode of publishing, e.g., "SCHEDULE" or "IMMEDIATE". - **scheduledAt** (string) - Optional - The date and time for the post to be published if publishMode is "SCHEDULE". - **postAsStory** (boolean) - Optional - Whether to also publish the content as a story. - **comment** (object) - Optional - Settings for an automated comment on the post. - **comment** (string) - Required if comment object is present - The text of the comment. - **delay** (integer) - Optional - Delay in seconds before the comment is posted. - **media** (array) - Optional - An array of media objects to attach to the post. - **id** (string) - Optional - The ID of an uploaded media item. - **url** (string) - Optional - The URL of an external media item. - **platforms** (object) - Optional - Platform-specific overrides and settings. - **instagram** (object) - Optional - Instagram-specific settings. - **collab** (string) - Optional - Username of the Instagram partner account for co-authoring. - **location** (object) - Optional - Geotag information. - **id** (string) - Required - Instagram's location ID. - **name** (string) - Required - Display name of the location. - **trialReel** (string) - Optional - Controls Instagram's Trial Reel feature ('MANUAL' or 'SS_PERFORMANCE'). - **shareToFeed** (boolean) - Optional - Whether to share Reels to the main feed. - **facebook** (object) - Optional - Facebook-specific settings. - **collab** (string) - Optional - Username of the Facebook partner account for co-authoring. - **location** (object) - Optional - Geotag information. - **id** (string) - Required - Facebook's location ID. - **name** (string) - Required - Display name of the location. - **tiktok** (object) - Optional - TikTok-specific settings. - **sendToInbox** (boolean) - Optional - Whether to send the TikTok to the inbox. - **youtube** (object) - Optional - YouTube-specific settings. - **tags** (array) - Optional - An array of tags for the YouTube video. - **playlists** (array) - Optional - An array of playlist objects. - **channelId** (integer) - Required - The ID of the YouTube channel. - **playlistIds** (array) - Required - An array of playlist IDs. ### Request Example ```json { "title": "Spring Collection Launch", "caption": "Our new Spring Collection is live 🌿 Hand-formulated with botanicals from our own garden. Link in bio to shop.", "alt": "Flat lay of Spring Collection skincare bottles on a bed of fresh herbs.", "link": "https://fernwoodbotanicals.example.com/spring", "publishMode": "SCHEDULE", "scheduledAt": "2026-10-10 12:12:00", "postAsStory": true, "comment": { "comment": "Tap the link above to see the full collection 🌱", "delay": 30 }, "media": [ { "id": "bWVkaWEvWThQT0NxWWFRcEtIRXZYMW16U0hsZFRnN0hFdEpYVzIubXA0" }, { "url": "https://media.nuelink.com/media/bWVkaWEvanNadVY5Rm8xODdMUWJLZ2wzUmRyd2gzTkNRbHdZVE1TdUpR" } ], "platforms": { "instagram": { "collab": "harperandvine", "location": { "id": "abc123", "name": "Brooklyn, NY" }, "trialReel": "MANUAL", "shareToFeed": true }, "facebook": { "collab": "harperandvine", "location": { "id": "abc123", "name": "Brooklyn, NY" } }, "tiktok": { "sendToInbox": true }, "youtube": { "tags": ["skincare", "botanicals", "spring-collection"], "playlists": [ { "channelId": 60107, "playlistIds": ["PL123", "PL456"] } ] } } } ``` ``` -------------------------------- ### Resource Not Found Error Example (404) Source: https://docs.nuelink.com/guides/errors Illustrates a 404 Not Found response when a referenced YouTube channel ID does not belong to the authenticated brand. ```json { "status": "error", "message": "Channel not found or does not belong to the brand", "errors": { "platforms.youtube.playlists.0.channelId": "Channel not found or does not belong to the brand" } } ``` -------------------------------- ### Create Post with All Options (PHP) Source: https://docs.nuelink.com/guides/endpoints/post-posts This PHP example shows how to prepare the post data and send it via cURL to the Nuelink API. It includes all available options for creating a post. Remember to replace placeholder values like YOUR_API_KEY. ```php 'Spring Collection Launch', 'caption' => 'Our new Spring Collection is live 🌿 Hand-formulated with botanicals from our own garden. Link in bio to shop.', 'alt' => 'Flat lay of Spring Collection skincare bottles on a bed of fresh herbs.', 'link' => 'https://fernwoodbotanicals.example.com/spring', 'publishMode' => 'SCHEDULE', 'scheduledAt' => '2026-10-10 12:12:00', 'postAsStory' => true, 'comment' => [ 'comment' => 'Tap the link above to see the full collection 🌱', 'delay' => 30, ], 'media' => [ ['id' => 'bWVkaWEvWThQT0NxWWFRcEtIRXZYMW16U0hsZFRnN0hFdEpYVzIubXA0'], ['url' => 'https://media.nuelink.com/media/bWVkaWEvanNadVY5Rm8xODdMUWJLZ2wzUmRyd2gzTkNRbHdZVE1TdUpR'], ], 'platforms' => [ 'instagram' => [ 'collab' => 'harperandvine', 'location' => ['id' => 'abc123', 'name' => 'Brooklyn, NY'], 'trialReel' => 'MANUAL', 'shareToFeed' => true, ], 'facebook' => [ 'collab' => 'harperandvine', 'location' => ['id' => 'abc123', 'name' => 'Brooklyn, NY'], ], 'tiktok' => [ 'sendToInbox' => true, ], 'youtube' => [ 'tags' => ['skincare', 'botanicals', 'spring-collection'], 'playlists' => [ ['channelId' => 60107, 'playlistIds' => ['PL123', 'PL456']], ], ], ], ]; $ch = curl_init('https://nuelink.com/api/public/v1/brands/13493/collections/40656/posts'); curl_setopt_array($ch, [ CURLOPT_POST => true, ``` -------------------------------- ### Create Post with All Options (JavaScript) Source: https://docs.nuelink.com/guides/endpoints/post-posts This JavaScript example demonstrates how to construct the request payload and send a POST request to create a post with all available options. Ensure you have your API key and the correct endpoint URL. ```javascript const payload = { title: 'Spring Collection Launch', caption: 'Our new Spring Collection is live 🌿 Hand-formulated with botanicals from our own garden. Link in bio to shop.', alt: 'Flat lay of Spring Collection skincare bottles on a bed of fresh herbs.', link: 'https://fernwoodbotanicals.example.com/spring', publishMode: 'SCHEDULE', scheduledAt: '2026-10-10 12:12:00', postAsStory: true, comment: { comment: 'Tap the link above to see the full collection 🌱', delay: 30, }, media: [ { id: 'bWVkaWEvWThQT0NxWWFRcEtIRXZYMW16U0hsZFRnN0hFdEpYVzIubXA0' }, { url: 'https://media.nuelink.com/media/bWVkaWEvanNadVY5Rm8xODdMUWJLZ2wzUmRyd2gzTkNRbHdZVE1TdUpR', }, ], platforms: { instagram: { collab: 'harperandvine', location: { id: 'abc123', name: 'Brooklyn, NY' }, trialReel: 'MANUAL', shareToFeed: true, }, facebook: { collab: 'harperandvine', location: { id: 'abc123', name: 'Brooklyn, NY' }, }, tiktok: { sendToInbox: true, }, youtube: { tags: ['skincare', 'botanicals', 'spring-collection'], playlists: [ { channelId: 60107, playlistIds: ['PL123', 'PL456'] }, ], }, }, }; const response = await fetch( 'https://nuelink.com/api/public/v1/brands/13493/collections/40656/posts', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify(payload), } ); const data = await response.json(); console.log(data); ``` -------------------------------- ### Create Comprehensive Post with All Options Source: https://docs.nuelink.com/reference/all This example demonstrates a comprehensive post request including title, caption, alt text, link, scheduled publishing, story posting, comments, multiple media items (ID and URL), and detailed platform-specific configurations for Instagram, Facebook, TikTok, and YouTube. Most requests will use a subset of these fields. ```bash curl -X POST https://nuelink.com/api/public/v1/brands/13493/collections/40656/posts \ -H “Authorization: Bearer YOUR_API_KEY” \ -H “Content-Type: application/json” \ -d ’{ “title”: “Spring Collection Launch”, “caption”: “Our new Spring Collection is live 🌿 Hand-formulated with botanicals from our own garden. Link in bio to shop.”, “alt”: “Flat lay of Spring Collection skincare bottles on a bed of fresh herbs.”, “link”: “https://fernwoodbotanicals.example.com/spring”, “publishMode”: “SCHEDULE”, “scheduledAt”: “2026-10-10 12:12:00”, “postAsStory”: true, “comment”: { “comment”: “Tap the link above to see the full collection 🌱”, “delay”: 30 }, “media”: [ { “id”: “bWVkaWEvWThQT0NxWWFRcEtIRXZYMW16U0hsZFRnN0hFdEpYVzIubXA0” }, { “url”: “https://media.nuelink.com/media/bWVkaWEvanNadVY5Rm8xODdMUWJLZ2wzUmRyd2gzTkNRbHdZVE1TdUpR” } ], “platforms”: { “instagram”: { “collab”: “harperandvine”, “location”: { “id”: “abc123”, “name”: “Brooklyn, NY” }, “trialReel”: “MANUAL”, “shareToFeed”: true }, “facebook”: { “collab”: “harperandvine”, “location”: { “id”: “abc123”, “name”: “Brooklyn, NY” } }, “tiktok”: { “sendToInbox”: true }, “youtube”: { “tags”: [“skincare”, “botanicals”, “spring-collection”], “playlists”: [ { “channelId”: 60107, “playlistIds”: [“PL123”, “PL456”] } ] } } }’ ``` -------------------------------- ### Create Immediate Text Post (JavaScript) Source: https://docs.nuelink.com/guides/endpoints/post-posts This JavaScript example demonstrates how to send a POST request to create an immediate text post. It includes setting the Authorization header and JSON content type. ```javascript const payload = { caption: 'New drop alert 🌿 The Rosewater Mist is back in stock — shop now at fernwoodbotanicals.example.com', publishMode: 'IMMEDIATE', }; const response = await fetch( 'https://nuelink.com/api/public/v1/brands/13493/collections/40656/posts', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify(payload), } ); const data = await response.json(); console.log(data); ``` -------------------------------- ### Create Poll Post Source: https://docs.nuelink.com/reference/all This example shows how to create a poll post. It includes setting the publish mode and defining the poll question, options, and duration. ```APIDOC ## POST /api/public/v1/brands/{brandId}/collections/{collectionId}/posts ### Description Creates a new poll post. This allows users to engage their audience with questions and multiple-choice answers. ### Method POST ### Endpoint /api/public/v1/brands/{brandId}/collections/{collectionId}/posts ### Parameters #### Request Body - **publishMode** (string) - Required - Mode of publishing, e.g., "IMMEDIATE". - **poll** (object) - Required - An object containing the poll details. - **question** (string) - Required - The question for the poll. - **options** (array) - Required - An array of strings representing the poll options. - **period** (string) - Required - The duration for which the poll will be active, e.g., "3d" for 3 days. ### Request Example ```json { "publishMode": "IMMEDIATE", "poll": { "question": "Which scent should we bring back for summer?", "options": ["Rosewater & Oak", "Wild Fig", "Jasmine Honey"], "period": "3d" } } ``` ``` -------------------------------- ### List Channels with PHP Source: https://docs.nuelink.com/guides/endpoints/get-channels Retrieve a list of channels for a brand using PHP cURL. This example demonstrates setting the Authorization header and handling the response. ```php [ 'Authorization: Bearer YOUR_API_KEY', ], CURLOPT_RETURNTRANSFER => true, ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` -------------------------------- ### Nuelink API Hierarchy Example Source: https://docs.nuelink.com/ Illustrates the three-level hierarchy used by Nuelink: Account, Brand, and Collections/Posts. Understanding this structure is key before making API calls. ```text Account └── Brand (workspace, e.g. "Fernwood Botanicals") ├── Channels (the connected social accounts: IG, X, TikTok, …) └── Collections (content folders grouped by theme or campaign) └── Posts (social media posts) ``` -------------------------------- ### Successful User Profile Response Source: https://docs.nuelink.com/guides/endpoints Example of a successful response (200 OK) when retrieving the user profile. ```json { "status": "success", "data": { "id": "7860a8ed7591c8eff18659a55b3e80e8", "name": "Maya Holloway", "joinedAt": "2022-05-23T23:55:51.000000Z", "timezone": "Europe/London" } } ``` -------------------------------- ### Get Collections for a Brand (cURL) Source: https://docs.nuelink.com/guides/endpoints/get-collections Use this cURL command to make a GET request to the collections endpoint for a specific brand. Replace YOUR_API_KEY with your actual API key. ```curl curl https://nuelink.com/api/public/v1/brands/99999999/collections \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Sample API Response for Brands Source: https://docs.nuelink.com/guides/endpoints/get-brands This is a sample JSON response for the GET /brands endpoint, showing the structure of the returned data, including brand details and pagination information. ```json { "status": "success", "data": [ { "id": 13493, "title": "Fernwood Botanicals", "description": "Main workspace for Fernwood Botanicals social channels", "timezone": "America/New_York", "createdAt": "2023-07-20T13:05:31.000000Z", "updatedAt": "2026-04-15T13:45:23.000000Z" } ], "pagination": { "currentPage": 1, "perPage": 10, "total": 2, "lastPage": 1, "nextPageUrl": null, "prevPageUrl": null } } ``` -------------------------------- ### Typical 401 Response: Token Required Source: https://docs.nuelink.com/guides/authentication Example of a 401 Unauthorized response when the authorization token is missing. ```json { "status": "error", "message": "Token is required", "errors": { "authorization": "Token is required" } } ``` -------------------------------- ### Get Collections for a Brand (JavaScript) Source: https://docs.nuelink.com/guides/endpoints/get-collections This JavaScript snippet demonstrates how to fetch collections for a brand using the Fetch API. Ensure you replace YOUR_API_KEY with your valid API key. ```javascript const response = await fetch( 'https://nuelink.com/api/public/v1/brands/99999999/collections', { headers: { Authorization: 'Bearer YOUR_API_KEY', }, } ); const data = await response.json(); console.log(data); ``` -------------------------------- ### GET /brands Source: https://docs.nuelink.com/guides/endpoints/get-brands Lists all brands the authenticated user has access to. Supports pagination via query parameters. ```APIDOC ## GET /brands ### Description Lists all brands the authenticated user has access to. ### Method GET ### Endpoint /brands ### Query Parameters #### Query Parameters - **page** (integer) - Optional - Page number. Defaults to 1. Minimum value is 1. - **per_page** (integer) - Optional - Items per page. Defaults to 10. Minimum value is 1, maximum value is 100. ### Request Example ```curl curl "https://nuelink.com/api/public/v1/brands?per_page=10&page=1" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ### Response #### Success Response (200 OK) - **status** (string) - Indicates the status of the response, e.g., "success". - **data** (array) - An array of brand objects. - **id** (integer) - Brand identifier. Use this as `brandId` in URLs. - **title** (string) - Display name of the brand. - **description** (string | null) - Optional free-text description. - **timezone** (string) - IANA timezone used by this brand for scheduling. - **createdAt** (string) - ISO 8601 timestamp. - **updatedAt** (string) - ISO 8601 timestamp. - **pagination** (object) - Contains pagination details. - **currentPage** (integer) - The current page number. - **perPage** (integer) - The number of items per page. - **total** (integer) - The total number of items available. - **lastPage** (integer) - The last page number. - **nextPageUrl** (string | null) - URL for the next page, or null if none. - **prevPageUrl** (string | null) - URL for the previous page, or null if none. #### Response Example ```json { "status": "success", "data": [ { "id": 13493, "title": "Fernwood Botanicals", "description": "Main workspace for Fernwood Botanicals social channels", "timezone": "America/New_York", "createdAt": "2023-07-20T13:05:31.000000Z", "updatedAt": "2026-04-15T13:45:23.000000Z" } ], "pagination": { "currentPage": 1, "perPage": 10, "total": 2, "lastPage": 1, "nextPageUrl": null, "prevPageUrl": null } } ``` ``` -------------------------------- ### Error Response: No File Sent Source: https://docs.nuelink.com/guides/endpoints/post-media This example shows the response when no media file is provided in the request. It returns a 422 Unprocessable Entity status with an error message indicating the media field is required. ```json { "status": "error", "message": "The given data was invalid.", "errors": { "media": [ "The media field is required." ] } } ``` -------------------------------- ### Error Response: File Too Large Source: https://docs.nuelink.com/guides/endpoints/post-media This example illustrates the response when the uploaded media file exceeds the maximum allowed size. It returns a 422 Unprocessable Entity status with an error message specifying the size limit. ```json { "status": "error", "message": "The given data was invalid.", "errors": { "media": [ "The media file may not be greater than 100 megabytes." ] } } ``` -------------------------------- ### Error Response: Unsupported File Type Source: https://docs.nuelink.com/guides/endpoints/post-media This example shows the response when an unsupported file type is uploaded. It returns a 422 Unprocessable Entity status with an error message listing the accepted media types. ```json { "status": "error", "message": "The given data was invalid.", "errors": { "media": [ "The media must be a file of type: png, jpg, jpeg, mp4, mov, pdf." ] } } ``` -------------------------------- ### Brand Not Found Error Source: https://docs.nuelink.com/reference/all This example demonstrates the request and response when attempting to retrieve collections for a brand that does not exist. The API returns a 404 Not Found status with an error message. ```bash curl "https://nuelink.com/api/public/v1/brands/99999999/collections" \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Request Without Token (JavaScript) Source: https://docs.nuelink.com/guides/authentication Example of making a request to the Nuelink API without including an authorization token using JavaScript's fetch API. This will result in a 401 error. ```javascript const response = await fetch('https://nuelink.com/api/public/v1/me'); const data = await response.json(); console.log(data); ``` -------------------------------- ### Validation Error Example (422) Source: https://docs.nuelink.com/guides/errors This example shows a 422 Unprocessable Entity response when the 'caption' field is missing and no 'poll' is provided. ```json { "status": "error", "message": "The given data was invalid.", "errors": { "caption": [ "The caption field is required when poll is not present." ] } } ``` -------------------------------- ### Validation Error Example Source: https://docs.nuelink.com/reference/all An example of a 422 Unprocessable Entity response due to validation errors, specifically when a caption is missing and no poll is provided. ```APIDOC ### Validation error example When the `caption` field is missing and no `poll` is provided: **Response: 422 Unprocessable Entity:** ```json { "status": "error", "message": "The given data was invalid.", "errors": { "caption": [ "The caption field is required when poll is not present." ] } } ``` ``` -------------------------------- ### Create Post with All Options (cURL) Source: https://docs.nuelink.com/guides/endpoints/post-posts Use this cURL command to create a post with all available options, including scheduling, comments, media, and platform-specific settings. Replace YOUR_API_KEY with your actual API key. ```curl curl -X POST https://nuelink.com/api/public/v1/brands/13493/collections/40656/posts \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Spring Collection Launch", "caption": "Our new Spring Collection is live 🌿 Hand-formulated with botanicals from our own garden. Link in bio to shop.", "alt": "Flat lay of Spring Collection skincare bottles on a bed of fresh herbs.", "link": "https://fernwoodbotanicals.example.com/spring", "publishMode": "SCHEDULE", "scheduledAt": "2026-10-10 12:12:00", "postAsStory": true, "comment": { "comment": "Tap the link above to see the full collection 🌱", "delay": 30 }, "media": [ { "id": "bWVkaWEvWThQT0NxWWFRcEtIRXZYMW16U0hsZFRnN0hFdEpYVzIubXA0" }, { "url": "https://media.nuelink.com/media/bWVkaWEvanNadVY5Rm8xODdMUWJLZ2wzUmRyd2gzTkNRbHdZVE1TdUpR" } ], "platforms": { "instagram": { "collab": "harperandvine", "location": { "id": "abc123", "name": "Brooklyn, NY" }, "trialReel": "MANUAL", "shareToFeed": true }, "facebook": { "collab": "harperandvine", "location": { "id": "abc123", "name": "Brooklyn, NY" } }, "tiktok": { "sendToInbox": true }, "youtube": { "tags": ["skincare", "botanicals", "spring-collection"], "playlists": [ { "channelId": 60107, "playlistIds": ["PL123", "PL456"] } ] } } }' ``` -------------------------------- ### Get authenticated user information Source: https://docs.nuelink.com/ Retrieves information about the currently authenticated user. ```APIDOC ## GET /me ### Description Retrieves information about the currently authenticated user. ### Method GET ### Endpoint /me ``` -------------------------------- ### Verify your token works Source: https://docs.nuelink.com/guides/quickstart This step verifies that your API key is valid by making a request to the /me endpoint. ```APIDOC ## GET /api/public/v1/me ### Description Verifies the provided API key by fetching user information. ### Method GET ### Endpoint /api/public/v1/me ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication. ``` -------------------------------- ### Get Current User Source: https://docs.nuelink.com/reference/all Verify your API token by fetching information about the authenticated user. ```APIDOC ## GET /me ### Description Fetches information about the currently authenticated user. ### Method GET ### Endpoint /me ### Request Example curl https://nuelink.com/api/public/v1/me \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Create Post with JavaScript Source: https://docs.nuelink.com/guides/quickstart This JavaScript code snippet shows how to create a post using the fetch API. It constructs the payload, sets the necessary headers, and sends a POST request to the Nuelink API. The response is then logged to the console. ```javascript const payload = { caption: 'Hello from the Nuelink API 👋', publishMode: 'IMMEDIATE', media: [{ id: 'MEDIA_ID_FROM_STEP_4' }], }; const response = await fetch( 'https://nuelink.com/api/public/v1/brands/BRAND_ID/collections/COLLECTION_ID/posts', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify(payload), } ); const data = await response.json(); console.log(data); ``` -------------------------------- ### Unauthorized Error Responses Source: https://docs.nuelink.com/reference/all Examples of 401 Unauthorized responses indicating missing, invalid, or revoked tokens. ```json { "status": "error", "message": "Token is required", "errors": { "authorization": "Token is required" } } ``` ```json { "status": "error", "message": "Token is invalid", "errors": { "authorization": "Token is invalid" } } ``` ```json { "status": "error", "message": "Token has been revoked", "errors": { "authorization": "Token has been revoked" } } ``` -------------------------------- ### Typical 401 Response: Revoked Token Source: https://docs.nuelink.com/guides/authentication Example of a 401 Unauthorized response when the provided authorization token has been revoked. ```json { "status": "error", "message": "Token has been revoked", "errors": { "authorization": "Token has been revoked" } } ``` -------------------------------- ### Typical 401 Response: Invalid Token Source: https://docs.nuelink.com/guides/authentication Example of a 401 Unauthorized response when the provided authorization token is invalid. ```json { "status": "error", "message": "Token is invalid", "errors": { "authorization": "Token is invalid" } } ``` -------------------------------- ### Create Post with Full Options (PHP cURL) Source: https://docs.nuelink.com/guides/endpoints/post-posts Demonstrates creating a post using PHP cURL with various options, including JSON payload, headers, and response handling. Ensure you replace 'YOUR_API_KEY' with your actual API key. ```php CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_HTTPHEADER => [ 'Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json', ], CURLOPT_RETURNTRANSFER => true, ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` -------------------------------- ### Get Collections for a Brand Source: https://docs.nuelink.com/guides/endpoints/get-collections This endpoint retrieves all collections associated with a given brand ID. Ensure you include your API key for authentication. ```APIDOC ## GET /api/public/v1/brands/{brandId}/collections ### Description Retrieves all collections associated with a specific brand. ### Method GET ### Endpoint /api/public/v1/brands/{brandId}/collections ### Parameters #### Path Parameters - **brandId** (string) - Required - The unique identifier of the brand. #### Query Parameters None #### Request Body None ### Request Example ```curl curl https://nuelink.com/api/public/v1/brands/99999999/collections \ -H "Authorization: Bearer YOUR_API_KEY" ``` ### Response #### Success Response (200) - **collections** (array) - A list of collections belonging to the brand. #### Error Response (404 Not Found) - **status** (string) - Indicates the error status, e.g., "error". - **message** (string) - A human-readable error message. - **errors** (object) - Contains specific error details. - **brand** (string) - Message indicating the brand was not found. ### Response Example (Error) ```json { "status": "error", "message": "Brand not found.", "errors": { "brand": "Brand not found." } } ``` ``` -------------------------------- ### GET User Profile Source: https://docs.nuelink.com/guides/endpoints Retrieves the authenticated user’s profile. This endpoint is useful as a health check to confirm a token is working. ```APIDOC ## GET /me ### Description Returns the authenticated user’s profile. Useful as a health check to confirm a token works. ### Method GET ### Endpoint /me ### Request Example ```curl https://nuelink.com/api/public/v1/me \ -H "Authorization: Bearer YOUR_API_KEY" ``` ### Response: `200 OK` ```json { "status": "success", "data": { "id": "7860a8ed7591c8eff18659a55b3e80e8", "name": "Maya Holloway", "joinedAt": "2022-05-23T23:55:51.000000Z", "timezone": "Europe/London" } } ``` ### Response fields - **id** (string) - Opaque user identifier. - **name** (string) - Display name on the Nuelink account. - **joinedAt** (string) - ISO 8601 timestamp of account creation. - **timezone** (string) - IANA timezone name (e.g. Europe/London). ``` -------------------------------- ### Create Scheduled Post with Single Image Source: https://docs.nuelink.com/reference/all Use this to schedule a post with a caption, alt text, and a single image. Ensure the media ID is correct and the publish mode is set to SCHEDULE with a future date. ```bash curl -X POST https://nuelink.com/api/public/v1/brands/13493/collections/40656/posts \ -H “Authorization: Bearer YOUR_API_KEY” \ -H “Content-Type: application/json” \ -d ’{ “caption”: “Something new is coming to the garden next week 🌱 Stay tuned.”, “alt”: “Close-up of dew on a fern leaf at sunrise.”, “publishMode”: “SCHEDULE”, “scheduledAt”: “2026-10-10 12:12:00”, “media”: [ { “id”: “bWVkaWEvcmo2dzRhSVY4YUJOMWJoU3c4U2t6VEJOenVXcjRoTmsuanBn” } ] }’ ``` -------------------------------- ### Create Immediate Text Post Source: https://docs.nuelink.com/reference/all Use this to create and immediately publish a text-based post. Ensure the Authorization header is set with your API key. ```bash curl -X POST https://nuelink.com/api/public/v1/brands/13493/collections/40656/posts \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d ’{ "caption": "New drop alert 🌱 The Rosewater Mist is back in stock - shop now at fernwoodbotanicals.example.com", "publishMode": "IMMEDIATE" }’ ``` -------------------------------- ### Error Response: Brand Not Found Source: https://docs.nuelink.com/guides/endpoints/get-collections This is an example of a 404 Not Found response when the specified brand ID does not exist. The response body details the error. ```json { "status": "error", "message": "Brand not found.", "errors": { "brand": "Brand not found." } } ``` -------------------------------- ### Create Immediate Text Post (cURL) Source: https://docs.nuelink.com/guides/endpoints/post-posts Use this cURL command to create a simple text post that is published immediately. Ensure you replace 'YOUR_API_KEY' with your actual API key. ```curl curl -X POST https://nuelink.com/api/public/v1/brands/13493/collections/40656/posts \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ \ "caption": "New drop alert 🌿 The Rosewater Mist is back in stock — shop now at fernwoodbotanicals.example.com", \ "publishMode": "IMMEDIATE" \ }' ``` -------------------------------- ### Request Without Token (cURL) Source: https://docs.nuelink.com/guides/authentication Example of making a request to the Nuelink API without including an authorization token. This will result in a 401 error. ```curl curl https://nuelink.com/api/public/v1/me ``` -------------------------------- ### Get Collections for a Brand (PHP) Source: https://docs.nuelink.com/guides/endpoints/get-collections This PHP code uses cURL to retrieve collections for a brand. Remember to substitute YOUR_API_KEY with your authentication token. ```php [ 'Authorization: Bearer YOUR_API_KEY', ], CURLOPT_RETURNTRANSFER => true, ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` -------------------------------- ### List Channels with JavaScript Source: https://docs.nuelink.com/guides/endpoints/get-channels Fetch channels for a brand using JavaScript's `fetch` API. Ensure you include your API key in the Authorization header and specify the desired pagination parameters. ```javascript const response = await fetch( 'https://nuelink.com/api/public/v1/brands/13493/channels?per_page=10&page=1', { headers: { Authorization: 'Bearer YOUR_API_KEY', }, } ); const data = await response.json(); console.log(data); ``` -------------------------------- ### Create Post with cURL Source: https://docs.nuelink.com/guides/quickstart Use this cURL command to create a new post via the Nuelink API. Ensure you replace BRAND_ID, COLLECTION_ID, YOUR_API_KEY, and MEDIA_ID_FROM_STEP_4 with your actual values. ```curl curl -X POST https://nuelink.com/api/public/v1/brands/BRAND_ID/collections/COLLECTION_ID/posts \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "caption": "Hello from the Nuelink API 👋", "publishMode": "IMMEDIATE", "media": [{ "id": "MEDIA_ID_FROM_STEP_4" }] }' ``` -------------------------------- ### Validation Error Response (422) Source: https://docs.nuelink.com/reference/all Example of a 422 Unprocessable Entity response for validation failures, where errors are returned as an array of strings per field. ```json { "status": "error", "message": "The given data was invalid.", "errors": { "caption": [ "The caption field is required when poll is not present." ], "scheduledAt": [ "The scheduled at field is required when publish mode is SCHEDULE.", "The scheduled at must be a future date." ] } } ``` -------------------------------- ### Get Authenticated User Profile Source: https://docs.nuelink.com/reference/all Retrieves the profile of the currently authenticated user. This is useful for verifying API key validity and basic user information. ```APIDOC ## GET /me ### Description Returns the authenticated user’s profile. Useful as a health check to confirm a token works. ### Method GET ### Endpoint https://nuelink.com/api/public/v1/me ### Request Example ```bash curl https://nuelink.com/api/public/v1/me \ -H "Authorization: Bearer YOUR_API_KEY" ``` ### Response #### Success Response (200 OK) ```json { "status": "success", "data": { "id": "7860a8ed7591c8eff18659a55b3e80e8", "name": "Maya Holloway", "joinedAt": "2022-05-23T23:55:51.000000Z", "timezone": "Europe/London" } } ``` #### Response fields: - **id** (string) - Opaque user identifier. - **name** (string) - Display name on the Nuelink account. - **joinedAt** (string) - ISO 8601 timestamp of account creation. - **timezone** (string) - IANA timezone name (e.g. Europe/London). ``` -------------------------------- ### List Brands with JavaScript Source: https://docs.nuelink.com/guides/endpoints/get-brands This JavaScript snippet demonstrates how to fetch a list of brands using the Fetch API. It includes setting the Authorization header with your API key and parsing the JSON response. ```javascript const response = await fetch( 'https://nuelink.com/api/public/v1/brands?per_page=10&page=1', { headers: { Authorization: 'Bearer YOUR_API_KEY', }, } ); const data = await response.json(); console.log(data); ``` -------------------------------- ### Create Immediate Text Post (PHP) Source: https://docs.nuelink.com/guides/endpoints/post-posts This PHP script shows how to create an immediate text post using cURL. It sets up the payload, headers, and sends the POST request to the API. ```php 'New drop alert 🌿 The Rosewater Mist is back in stock — shop now at fernwoodbotanicals.example.com', 'publishMode' => 'IMMEDIATE', ]; $ch = curl_init('https://nuelink.com/api/public/v1/brands/13493/collections/40656/posts'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_HTTPHEADER => [ 'Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json', ], CURLOPT_RETURNTRANSFER => true, ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` -------------------------------- ### List Brands with PHP Source: https://docs.nuelink.com/guides/quickstart Use PHP cURL to list your brands. Note the brand ID for future API calls. ```php [ 'Authorization: Bearer YOUR_API_KEY', ], CURLOPT_RETURNTRANSFER => true, ]); $response = curl_exec($ch); curl_close($ch); echo $response; ```