{
    "name": "Sociamonials \u2014 create a draft post",
    "nodes": [
        {
            "parameters": {
                "content": "1. Create a credential: Credentials \u2192 New \u2192 Header Auth.\n   Name: Authorization  Value: paste your API key (it looks like sm_agent_XXXX;\n   the 'Bearer ' prefix is optional).\n   Create a key at https://www.sociamonials.com/login.php?redirect=accounts%2Fapi_keys.php\n   (sign in first, then Create API Key.)\n2. Select that credential on all three HTTP Request nodes below.\n3. Click 'Execute Workflow'. 'List workspaces' runs first and its workspace id\n   is mapped into 'List social profiles' for you \u2014 nothing to fill in.\n4. Put your text in 'message' and paste a profile ID from the 'List social\n   profiles' output into 'profile_refs'. Leave fields you don't need EMPTY.\n   Field guide: https://www.sociamonials.com/developers.php#no-code\n5. The last node creates a DRAFT post (publishes nothing).\n\nREADING A REPORT LATER\nThe reports return their rows INSIDE an array \u2014 messages[] on\nhttps://www.sociamonials.com/api/v1/workspaces/<id>/published-messages\nand campaigns[] on .../campaigns-report. One HTTP node returns ONE item\nholding the whole array, so a following node only ever sees the first row.\nAdd a 'Split Out' node (older n8n: 'Item Lists' \u2192 Split Out Items) after the\nHTTP node and set the field to 'messages' (or 'campaigns'). Every following\nnode then runs once per row.",
                "height": 340,
                "width": 480
            },
            "name": "Read me first",
            "type": "n8n-nodes-base.stickyNote",
            "typeVersion": 1,
            "position": [
                160,
                40
            ]
        },
        {
            "parameters": {},
            "name": "When you click Execute",
            "type": "n8n-nodes-base.manualTrigger",
            "typeVersion": 1,
            "position": [
                200,
                440
            ]
        },
        {
            "parameters": {
                "url": "https://www.sociamonials.com/api/v1/workspaces",
                "authentication": "genericCredentialType",
                "genericAuthType": "httpHeaderAuth",
                "options": {}
            },
            "name": "List workspaces",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 4.2,
            "position": [
                420,
                440
            ]
        },
        {
            "parameters": {
                "url": "=https://www.sociamonials.com/api/v1/workspaces/{{ $json.workspaces[0].workspace_registration_id }}/social-profiles",
                "authentication": "genericCredentialType",
                "genericAuthType": "httpHeaderAuth",
                "options": {}
            },
            "name": "List social profiles",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 4.2,
            "position": [
                640,
                440
            ]
        },
        {
            "parameters": {
                "method": "POST",
                "url": "https://www.sociamonials.com/api/v1/posts",
                "authentication": "genericCredentialType",
                "genericAuthType": "httpHeaderAuth",
                "sendBody": true,
                "specifyBody": "json",
                "jsonBody": "{\"mode\":\"draft\",\"message\":\"Type your post here, or map a field from your data\",\"networks\":{\"fb\":{\"profile_refs\":[\"Paste your profile ID from the API Keys page\"],\"message\":\"\"}},\"publish_at\":\"\",\"link\":\"\",\"image_urls\":[],\"video_url\":\"\",\"video_thumbnail_url\":\"\",\"alt_text\":\"\",\"first_comment\":\"\",\"category\":\"\",\"watermark\":\"\",\"hashtag_group\":\"\",\"cta_group\":\"\",\"post_preset\":\"\",\"team_note\":\"\"}",
                "options": {}
            },
            "name": "Create draft post",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 4.2,
            "position": [
                860,
                440
            ]
        }
    ],
    "connections": {
        "When you click Execute": {
            "main": [
                [
                    {
                        "node": "List workspaces",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "List workspaces": {
            "main": [
                [
                    {
                        "node": "List social profiles",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "List social profiles": {
            "main": [
                [
                    {
                        "node": "Create draft post",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "settings": {
        "executionOrder": "v1"
    }
}