WingifyGuides

Create a campaign section

Request URI for Sub Account

POST /accounts/40505/campaigns/8/sections

{`

`}

Request Format

{
    "sections": {
        "name": "New shiny section",
        "cssSelector": "DIV#js-header-fixed-trigger + SECTION > DIV:first-child > DIV:first-child > DIV:first-child",
        "variations": [
            {
                "name": "New shiny variation"
            }
        ]
    }
}

Create a campaign section

#OpenAPI definition

{
  "openapi": "3.1.0",
  "info": {
    "title": "api",
    "version": "4"
  },
  "servers": [
    {
      "url": "https://app.wingify.com/api/v2"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "token"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/accounts/{account_id}/campaigns/{campaign_id}/sections": {
      "post": {
        "summary": "Create a campaign section",
        "description": "",
        "operationId": "create-a-campaign-section",
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "description": "Use 'current' keyword to refer to the Main Workspace or the Integer Workspace Id",
            "required": true,
            "schema": {
              "type": "string",
              "default": "current"
            }
          },
          {
            "name": "campaign_id",
            "in": "path",
            "description": "Campaign Id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"_data\": [\n        {\n            \"id\": 2,\n            \"name\": \"New shiny section\",\n            \"cssSelector\": \"DIV#js-header-fixed-trigger + SECTION > DIV:first-child > DIV:first-child > DIV:first-child\",\n            \"variations\": [\n                {\n                    \"id\": 1,\n                    \"name\": \"Control\",\n                    \"isControl\": true,\n                    \"isDisabled\": false,\n                    \"heatmapThumbUrl\": \"<url>\",\n                    \"screenshots\": {\n                        \"quick\": \"<url>\"\n                    },\n                    \"editorData\": {\n                        \"stack\": []\n                    }\n                }\n            ]\n        }\n    ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 2,
                            "default": 0
                          },
                          "name": {
                            "type": "string",
                            "example": "New shiny section"
                          },
                          "cssSelector": {
                            "type": "string",
                            "example": "DIV#js-header-fixed-trigger + SECTION > DIV:first-child > DIV:first-child > DIV:first-child"
                          },
                          "variations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "integer",
                                  "example": 1,
                                  "default": 0
                                },
                                "name": {
                                  "type": "string",
                                  "example": "Control"
                                },
                                "isControl": {
                                  "type": "boolean",
                                  "example": true,
                                  "default": true
                                },
                                "isDisabled": {
                                  "type": "boolean",
                                  "example": false,
                                  "default": true
                                },
                                "heatmapThumbUrl": {
                                  "type": "string",
                                  "example": "<url>"
                                },
                                "screenshots": {
                                  "type": "object",
                                  "properties": {
                                    "quick": {
                                      "type": "string",
                                      "example": "<url>"
                                    }
                                  }
                                },
                                "editorData": {
                                  "type": "object",
                                  "properties": {
                                    "stack": {
                                      "type": "array"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}