WingifyGuides

Update draft campaigns

Request Format

{
  "draftId": 14597,
  "createdBy": 1,
  "platform": "website",
  "isAdvancedMode": false,
  "currentDraftStepIndex": 3,
  "type": "ab",
  "urls": [
    {
      "type": "url",
      "value": "http://wingify.com"
    }
  ],
  "primaryUrl": "http://wingify.com",
  "globalSegment": {
    "segmentationType": "pre",
    "platform": "website",
    "id": "1",
    "type": "predefined",
    "name": "Direct",
    "description": "Segment to allow only direct traffic"
  },
  "variations": [
    {
      "platform": "website",
      "id": 1,
      "name": "Control",
      "editorData": {
        "stack": []
      },
      "deployContent": [],
      "segmentEligibility": "ALL",
      "segment": {
        "type": "custom",
        "eligibility": "ALL"
      },
      "percentSplit": 50
    },
    {
      "platform": "website",
      "id": 2,
      "name": "Variation 1",
      "editorData": {
        "stack": [
          {
            "el": 0,
            "op": {
              "opName": "html",
              "html": "The company pioneered easy A/B testing"
            },
            "depending": false,
            "XPath": "BODY > NOSCRIPT:first-child + SCRIPT + HEADER#top_header + SECTION > DIV:first-child > DIV:first-child > H2:first-child",
            "parentTag": "DIV"
          }
        ]
      },
      "deployContent": [
        {
          "jsString": "var ctx=vwo_$(x);ctx.html(\"The company pioneered easy A/B testing\");",
          "cssSelector": "HEADER#top_header + SECTION > DIV:first-child > DIV:first-child > H2:first-child"
        }
      ],
      "segmentEligibility": "ALL",
      "segment": {
        "type": "custom",
        "eligibility": "ALL"
      },
      "percentSplit": 50
    }
  ],
  "status": "draft",
  "goals": [
    {
      "id": 1,
      "name": "Goal 1",
      "type": "visitPage",
      "isPrimary": true,
      "urls": [
        {
          "type": "url",
          "value": "http://wingify.com"
        }
      ],
      "cssSelectors": []
    }
  ],
  "name": "test Campaign",
  "newCampaignName": "Campaign 142",
  "percentTraffic": 100,
  "isHeatmapEnabled": true,
  "numVariationsWithEligibilitySeg": 0,
  "isCustomSplitEnabled": false,
  "integrations": {
    "ga": {
      "enabled": false,
      "slot": 4,
      "prefix": ""
    },
    "clicktale": {
      "enabled": false
    },
    "ua": {
      "enabled": false,
      "dimension": 1,
      "prefix": ""
    },
    "gtm": {
      "enabled": false
    },
    "isGaPremium": false
  },
  "isPostSegmentationEnabled": false
}

Update draft for a Workspace

#

Request URI for Sub Account
PATCH /accounts/1/drafts/14597
  

#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}/drafts/{draft_id}": {
      "patch": {
        "summary": "Update draft campaigns",
        "description": "",
        "operationId": "update-draft-of-current--sub-account",
        "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": "draft_id",
            "in": "path",
            "description": "Draft Id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"_data\": {\n    \"draftId\": 14597,\n    \"createdOn\": 1416225457,\n    \"createdBy\": {\n      \"id\": 1,\n      \"name\": \"Backend Testing\"\n    }\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_data": {
                      "type": "object",
                      "properties": {
                        "draftId": {
                          "type": "integer",
                          "example": 14597,
                          "default": 0
                        },
                        "createdOn": {
                          "type": "integer",
                          "example": 1416225457,
                          "default": 0
                        },
                        "createdBy": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer",
                              "example": 1,
                              "default": 0
                            },
                            "name": {
                              "type": "string",
                              "example": "Backend Testing"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}