{"id":1074,"date":"2020-06-27T23:26:41","date_gmt":"2020-06-27T23:26:41","guid":{"rendered":"https:\/\/sweepwidget.com\/docs\/?p=1074"},"modified":"2026-11-19T10:29:51","modified_gmt":"2026-11-19T10:29:51","slug":"sweepwidget-api","status":"publish","type":"post","link":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api","title":{"rendered":"SweepWidget API Documentation"},"content":{"rendered":"<p>The SweepWidget API allows you to read and write data to your giveaways. If you need any specific functionality that is not currently available, feel free to contact support.<\/p>\n<p><strong>Plan:<\/strong> The API is available on the <strong>Enterprise plan<\/strong> only. On other plans the API key is hidden and every call returns <code>{\"message\":\"API access not allowed.\"}<\/code>.<\/p>\n<p>Base URL <code>https:\/\/sweepwidgetapi.com\/sw_api\/<\/code><\/p>\n<h3 id=\"getting-your-api-key\">Getting Your API Key<\/h3>\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"568\" src=\"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1-1024x568.png\" alt=\"\" class=\"wp-image-7306\" srcset=\"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1-1024x568.png 1024w, https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1-300x166.png 300w, https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1-768x426.png 768w, https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1.png 1500w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-2-1024x567.png\" alt=\"\" class=\"wp-image-7307\" srcset=\"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-2-1024x567.png 1024w, https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-2-300x166.png 300w, https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-2-768x425.png 768w, https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-2.png 1500w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<ol type=\"1\">\n<li>Click <strong>Integrations<\/strong> in the left sidebar.<\/li>\n<li>Click the <strong>SweepWidget API<\/strong> card.<\/li>\n<li>Copy the key in the <strong>API Key<\/strong> field.<\/li>\n<\/ol>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"567\" src=\"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-3-1024x567.png\" alt=\"\" class=\"wp-image-7308\" srcset=\"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-3-1024x567.png 1024w, https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-3-300x166.png 300w, https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-3-768x425.png 768w, https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-3.png 1500w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<p>Each brand has its own API key. The page shows the key of the brand you have selected, and that brand must be on the Enterprise plan.<\/p>\n<h3 id=\"authentication\">Authentication<\/h3>\n<p>All API requests require authentication using your API key. Send your API key as a Bearer token in the Authorization header:<\/p>\n<pre><code>Authorization: Bearer YOUR_API_KEY<\/code><\/pre>\n<p>Backward compatible: you can also pass <code>api_key<\/code> as a query parameter (GET) or form field (POST). Both methods are supported.<\/p>\n<h3 id=\"how-to-make-requests\">How to make requests<\/h3>\n<p><strong>GET endpoints (reading data):<\/strong> Pass parameters as query string values in the URL.<\/p>\n<pre><code>GET https:\/\/sweepwidgetapi.com\/sw_api\/users?competition_id=123&amp;page_start=1\nAuthorization: Bearer YOUR_API_KEY<\/code><\/pre>\n<p><strong>POST endpoints (writing data):<\/strong> Send parameters in the request body as JSON. Set the Content-Type header to <code>application\/json<\/code>.<\/p>\n<pre><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/new-entry\nAuthorization: Bearer YOUR_API_KEY\nContent-Type: application\/json\n \n{\n  &quot;competition_id&quot;: 123,\n  &quot;user_name&quot;: &quot;Jane&quot;,\n  &quot;user_email&quot;: &quot;jane@example.com&quot;,\n  &quot;entry_amount&quot;: 1,\n  &quot;giveaway_link&quot;: &quot;https:\/\/yoursite.com&quot;\n}<\/code><\/pre>\n<p><strong>Important:<\/strong> For POST endpoints, parameters must be sent in the request body, not in the URL. Putting POST parameters in the URL query string (e.g. <code>\/new-entry?competition_id=123&amp;user_email=...<\/code>) will not work.<\/p>\n<h3 id=\"rate-limit\">Rate limit<\/h3>\n<p>Send no more than 1 request per second. Faster calls are rejected with:<\/p>\n<pre><code>{&quot;message&quot;: &quot;RATE LIMIT! You are only allowed 1 API call per second.&quot;}<\/code><\/pre>\n<p>Rejected calls also count toward the limit, so wait a second before you retry.<\/p>\n<h3 id=\"errors\">Errors<\/h3>\n<p>Errors are returned with HTTP status 200 and a JSON body with a <code>message<\/code> field. Check for <code>message<\/code> in every response. Common messages:<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Message<\/th>\n<th>Meaning<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>Invalid credentials.<\/code><\/td>\n<td>The API key is wrong.<\/td>\n<\/tr>\n<tr>\n<td><code>API access not allowed.<\/code><\/td>\n<td>The brand is not on the Enterprise plan, or the giveaway is not yours.<\/td>\n<\/tr>\n<tr>\n<td><code>This competition ID doesn't belong to you.<\/code><\/td>\n<td>The competition_id is not one of your giveaways.<\/td>\n<\/tr>\n<tr>\n<td><code>RATE LIMIT! You are only allowed 1 API call per second.<\/code><\/td>\n<td>Slow down.<\/td>\n<\/tr>\n<tr>\n<td><code>&lt;parameter&gt; is not set.<\/code><\/td>\n<td>A required parameter is missing.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 id=\"quick-start-examples\">Quick start examples<\/h3>\n<h4 id=\"curl\">cURL<\/h4>\n<pre><code># GET - List all users for a giveaway\ncurl &quot;https:\/\/sweepwidgetapi.com\/sw_api\/users?competition_id=123&amp;page_start=1&quot; \\\n  -H &quot;Authorization: Bearer YOUR_API_KEY&quot;\n \n# POST - Enter a user into a giveaway\ncurl -X POST &quot;https:\/\/sweepwidgetapi.com\/sw_api\/new-entry&quot; \\\n  -H &quot;Authorization: Bearer YOUR_API_KEY&quot; \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -d &#39;{\n    &quot;competition_id&quot;: 123,\n    &quot;user_name&quot;: &quot;Jane&quot;,\n    &quot;user_email&quot;: &quot;jane@example.com&quot;,\n    &quot;entry_amount&quot;: 1,\n    &quot;giveaway_link&quot;: &quot;https:\/\/yoursite.com&quot;\n  }&#39;<\/code><\/pre>\n<h4 id=\"python\">Python<\/h4>\n<pre class=\"python\"><code>import requests\n \nAPI_KEY = &quot;YOUR_API_KEY&quot;\nheaders = {&quot;Authorization&quot;: f&quot;Bearer {API_KEY}&quot;}\n \n# GET - List all users for a giveaway\nresponse = requests.get(\n    &quot;https:\/\/sweepwidgetapi.com\/sw_api\/users&quot;,\n    params={&quot;competition_id&quot;: 123, &quot;page_start&quot;: 1},\n    headers=headers\n)\nprint(response.json())\n \n# POST - Enter a user into a giveaway\nresponse = requests.post(\n    &quot;https:\/\/sweepwidgetapi.com\/sw_api\/new-entry&quot;,\n    json={\n        &quot;competition_id&quot;: 123,\n        &quot;user_name&quot;: &quot;Jane&quot;,\n        &quot;user_email&quot;: &quot;jane@example.com&quot;,\n        &quot;entry_amount&quot;: 1,\n        &quot;giveaway_link&quot;: &quot;https:\/\/yoursite.com&quot;\n    },\n    headers=headers\n)\nprint(response.json())<\/code><\/pre>\n<h4 id=\"javascript-nodejs\">JavaScript (Node.js)<\/h4>\n<pre class=\"javascript\"><code>const API_KEY = &quot;YOUR_API_KEY&quot;;\nconst headers = {\n  &quot;Authorization&quot;: `Bearer ${API_KEY}`,\n  &quot;Content-Type&quot;: &quot;application\/json&quot;\n};\n \n\/\/ GET - List all users for a giveaway\nconst usersRes = await fetch(\n  &quot;https:\/\/sweepwidgetapi.com\/sw_api\/users?competition_id=123&amp;page_start=1&quot;,\n  { headers }\n);\nconst users = await usersRes.json();\n \n\/\/ POST - Enter a user into a giveaway\nconst entryRes = await fetch(\n  &quot;https:\/\/sweepwidgetapi.com\/sw_api\/new-entry&quot;,\n  {\n    method: &quot;POST&quot;,\n    headers,\n    body: JSON.stringify({\n      competition_id: 123,\n      user_name: &quot;Jane&quot;,\n      user_email: &quot;jane@example.com&quot;,\n      entry_amount: 1,\n      giveaway_link: &quot;https:\/\/yoursite.com&quot;\n    })\n  }\n);\nconst result = await entryRes.json();<\/code><\/pre>\n<h3 id=\"api-endpoints\">API Endpoints<\/h3>\n<h4 id=\"read-endpoints\">Read Endpoints<\/h4>\n<ul>\n<li>GET List all users for a giveaway<\/li>\n<li>GET List all winners for a giveaway<\/li>\n<li>GET List all entries for a giveaway<\/li>\n<li>GET List all giveaways<\/li>\n<li>GET List all entries for a single user<\/li>\n<li>GET List all giveaways a user has entered<\/li>\n<li>GET Fetch referral link for a user<\/li>\n<\/ul>\n<h4 id=\"write-endpoints\">Write Endpoints<\/h4>\n<ul>\n<li>POST Update whitelisted emails<\/li>\n<li>POST Add new entry method<\/li>\n<li>POST Update an entry method<\/li>\n<li>POST Delete an entry method<\/li>\n<li>POST Create a giveaway<\/li>\n<li>POST Update a giveaway<\/li>\n<li>POST Delete a giveaway<\/li>\n<li>POST Add a prize to a giveaway<\/li>\n<li>POST Add an unlock reward to a giveaway<\/li>\n<li>POST Add manual entries for a user<\/li>\n<li>POST Enter user into a giveaway<\/li>\n<li>POST Submit an entry with a file upload<\/li>\n<\/ul>\n<h3 id=\"list-all-users-for-a-giveaway\">List all users for a giveaway<\/h3>\n<p>This method allows you to get each unique user that has entered a giveaway.<\/p>\n<p><code>GET https:\/\/sweepwidgetapi.com\/sw_api\/users<\/code><\/p>\n<h4 id=\"parameters\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>page_start<\/td>\n<td>Integer<\/td>\n<td>The page you want to start on. Page 1 returns the first 50 users. Pages 2 and later can return up to 100 rows that overlap the next page, so remove duplicates by user_id.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request\">Example Request<\/h4>\n<pre class=\"php\"><code>$curl = curl_init();\n \n$url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/users?page_start=1&amp;competition_id=123&quot;;\n \ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; $url,\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; &quot;&quot;,\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; &quot;GET&quot;,\n  CURLOPT_HTTPHEADER =&gt; array(\n    &quot;Authorization: Bearer YOUR_API_KEY&quot;,\n    &quot;Content-Type: application\/json&quot;\n  ),\n));\n \n$response = json_decode(curl_exec($curl));\nvar_dump($response);<\/code><\/pre>\n<h4 id=\"example-response\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;data&quot;: [\n    {\n      &quot;user_id&quot;: 123,\n      &quot;user_name&quot;: &quot;Test User&quot;,\n      &quot;user_email&quot;: &quot;one@test.com&quot;,\n      &quot;birthday&quot;: &quot;04-25-1994&quot;,\n      &quot;custom_identifier&quot;: &quot;your-reference-id&quot;,\n      &quot;entry_type&quot;: &quot;User Details&quot;,\n      &quot;timestamp&quot;: &quot;2020-06-26 11:18:21&quot;,\n      &quot;country&quot;: &quot;United States&quot;\n    }\n  ]\n}<\/code><\/pre>\n<p>When there are no more rows, the response is a plain JSON string such as <code>\"No entries on page 50.\"<\/code> instead of a <code>data<\/code> object.<\/p>\n<h3 id=\"list-all-winners-for-a-giveaway\">List all winners for a giveaway<\/h3>\n<p>This method allows you to fetch all of the winners for a giveaway.<\/p>\n<p><code>GET https:\/\/sweepwidgetapi.com\/sw_api\/winners<\/code><\/p>\n<h4 id=\"parameters-1\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>page_start<\/td>\n<td>Integer<\/td>\n<td>The page you want to start on. JSON output returns 50 rows at a time.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-1\">Example Request<\/h4>\n<pre class=\"php\"><code>$curl = curl_init();\n \n$url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/winners?page_start=1&amp;competition_id=123&quot;;\n \ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; $url,\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; &quot;&quot;,\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; &quot;GET&quot;,\n  CURLOPT_HTTPHEADER =&gt; array(\n    &quot;Authorization: Bearer YOUR_API_KEY&quot;,\n    &quot;Content-Type: application\/json&quot;\n  ),\n));\n \n$response = json_decode(curl_exec($curl));\nvar_dump($response);<\/code><\/pre>\n<h4 id=\"example-response-1\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;data&quot;: [\n    {\n      &quot;user_id&quot;: 123,\n      &quot;user_name&quot;: &quot;Test User&quot;,\n      &quot;user_email&quot;: &quot;one@test.com&quot;,\n      &quot;birthday&quot;: &quot;04-25-1994&quot;,\n      &quot;custom_identifier&quot;: &quot;your-reference-id&quot;,\n      &quot;country&quot;: &quot;United States&quot;\n    }\n  ]\n}<\/code><\/pre>\n<h3 id=\"list-all-entries-for-a-giveaway\">List all entries for a giveaway<\/h3>\n<p>This method allows you to access all of the user entry information for a giveaway.<\/p>\n<p><code>GET https:\/\/sweepwidgetapi.com\/sw_api\/entries<\/code><\/p>\n<h4 id=\"parameters-2\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>page_start<\/td>\n<td>Integer<\/td>\n<td>The page you want to start on. JSON output returns 50 rows at a time.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-2\">Example Request<\/h4>\n<pre class=\"php\"><code>$curl = curl_init();\n \n$url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/entries?page_start=1&amp;competition_id=123&quot;;\n \ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; $url,\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; &quot;&quot;,\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; &quot;GET&quot;,\n  CURLOPT_HTTPHEADER =&gt; array(\n    &quot;Authorization: Bearer YOUR_API_KEY&quot;,\n    &quot;Content-Type: application\/json&quot;\n  ),\n));\n \n$response = json_decode(curl_exec($curl));\nvar_dump($response);<\/code><\/pre>\n<h4 id=\"example-response-2\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;data&quot;: [\n    {\n      &quot;user_id&quot;: 123,\n      &quot;user_name&quot;: &quot;Test User&quot;,\n      &quot;user_email&quot;: &quot;one@test.com&quot;,\n      &quot;birthday&quot;: &quot;04-25-1994&quot;,\n      &quot;custom_identifier&quot;: &quot;your-reference-id&quot;,\n      &quot;entry_type&quot;: &quot;Twitter Follow&quot;,\n      &quot;action&quot;: &quot;Follow @SweepWidget On Twitter&quot;,\n      &quot;value&quot;: &quot;@MyTwitter&quot;,\n      &quot;entry_amount&quot;: &quot;5&quot;,\n      &quot;timestamp&quot;: &quot;2020-06-26 11:18:21&quot;,\n      &quot;country&quot;: &quot;United States&quot;\n    }\n  ]\n}<\/code><\/pre>\n<p>The response does not include the entry method&#8217;s entry_id. When there are no more rows, the response is a plain JSON string such as <code>\"No entries on page 50.\"<\/code>.<\/p>\n<h3 id=\"list-all-giveaways\">List all giveaways<\/h3>\n<p>This method allows you to access basic information about all live, scheduled, and expired giveaways on your account (all brands).<\/p>\n<p><code>GET https:\/\/sweepwidgetapi.com\/sw_api\/giveaways<\/code><\/p>\n<h4 id=\"parameters-3\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>type<\/td>\n<td>String<\/td>\n<td>Accepts any of the 3 values: live, scheduled, expired<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>page_start<\/td>\n<td>Integer<\/td>\n<td>The page you want to start on. Each page looks at 50 of your giveaways (newest first, all statuses) and returns the ones that match <code>type<\/code>. A page can return fewer than 50 results, or none, even when later pages have more. Keep requesting pages until a page returns no results for every type.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-3\">Example Request<\/h4>\n<pre class=\"php\"><code>$curl = curl_init();\n \n$url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/giveaways?type=live&amp;page_start=1&quot;;\n \ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; $url,\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; &quot;&quot;,\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; &quot;GET&quot;,\n  CURLOPT_HTTPHEADER =&gt; array(\n    &quot;Authorization: Bearer YOUR_API_KEY&quot;,\n    &quot;Content-Type: application\/json&quot;\n  ),\n));\n \n$response = json_decode(curl_exec($curl));\nvar_dump($response);<\/code><\/pre>\n<h4 id=\"example-response-3\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;data&quot;: [\n    {\n      &quot;competition_id&quot;: 123,\n      &quot;competition_url&quot;: &quot;ahej14f9&quot;,\n      &quot;type&quot;: &quot;Live&quot;,\n      &quot;title&quot;: &quot;My Giveaway Title&quot;,\n      &quot;description&quot;: &quot;This is the description of my awesome giveaway!&quot;,\n      &quot;rules&quot;: &quot;US, CA, 18+&quot;,\n      &quot;start_time&quot;: &quot;2020-07-28 00:00:00&quot;,\n      &quot;end_time&quot;: &quot;2020-08-28 00:00:00&quot;,\n      &quot;time_zone&quot;: &quot;America\/Chicago&quot;,\n      &quot;number_of_winners&quot;: &quot;5&quot;,\n      &quot;image_loc&quot;: &quot;https:\/\/sweepwidget.com\/images\/my-image.jpg&quot;,\n      &quot;giveaway_embed_code&quot;: &quot;PGRpdiBpZD0i...&quot;\n    }\n  ]\n}<\/code><\/pre>\n<p><strong>Important:<\/strong> The <code>giveaway_embed_code<\/code> is outputted in base 64 encoded format (because it contains HTML). You must base 64 decode this value to get the HTML. In PHP, the function would be <code>base64_decode($value);<\/code><\/p>\n<h3 id=\"list-all-entries-for-a-single-user-in-a-giveaway\">List all entries for a single user in a giveaway<\/h3>\n<p>This method allows you to list all of the entries a user has completed in a single giveaway.<\/p>\n<p><code>GET https:\/\/sweepwidgetapi.com\/sw_api\/user-entries<\/code><\/p>\n<h4 id=\"parameters-4\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>user_email<\/td>\n<td>String<\/td>\n<td>This is the email address of the user who entered.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-4\">Example Request<\/h4>\n<pre class=\"php\"><code>&lt;?php\n$curl = curl_init();\n \n$url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/user-entries?competition_id=123&amp;user_email=test@test.com&quot;;\n \ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; $url,\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; &quot;&quot;,\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; &quot;GET&quot;,\n  CURLOPT_HTTPHEADER =&gt; array(\n    &quot;Authorization: Bearer YOUR_API_KEY&quot;,\n    &quot;Content-Type: application\/json&quot;\n  ),\n));\n \n$response = json_decode(curl_exec($curl));\nvar_dump($response);<\/code><\/pre>\n<h4 id=\"example-response-4\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;custom_identifier&quot;: null,\n  &quot;entries&quot;: [\n    {\n      &quot;entry_type&quot;: &quot;User Details&quot;,\n      &quot;action&quot;: &quot;Login&quot;,\n      &quot;value&quot;: &quot;Auto Verified&quot;,\n      &quot;entry_amount&quot;: 1,\n      &quot;timestamp&quot;: &quot;2024-02-29 15:13:51&quot;\n    },\n    {\n      &quot;entry_type&quot;: &quot;Facebook Page Visit&quot;,\n      &quot;action&quot;: &quot;NULL&quot;,\n      &quot;value&quot;: &quot;Auto Verified&quot;,\n      &quot;entry_amount&quot;: 1,\n      &quot;timestamp&quot;: &quot;2024-03-01 19:44:52&quot;\n    },\n    {\n      &quot;entry_type&quot;: &quot;Instagram Follow&quot;,\n      &quot;action&quot;: &quot;NULL&quot;,\n      &quot;value&quot;: &quot;Test&quot;,\n      &quot;entry_amount&quot;: 1,\n      &quot;timestamp&quot;: &quot;2024-03-01 19:44:58&quot;\n    },\n    {\n      &quot;entry_type&quot;: &quot;Email Subscribe&quot;,\n      &quot;action&quot;: &quot;NULL&quot;,\n      &quot;value&quot;: &quot;Auto Verified&quot;,\n      &quot;entry_amount&quot;: 1,\n      &quot;timestamp&quot;: &quot;2024-03-04 19:07:05&quot;\n    }\n  ]\n}<\/code><\/pre>\n<p>If the user has no entries, the response is a plain JSON string such as <code>\"No entries for user test@test.com in competition 123.\"<\/code>.<\/p>\n<h3 id=\"list-all-giveaways-a-user-has-entered\">List all giveaways a user has entered<\/h3>\n<p>This method allows you to list every giveaway a user has entered. It returns the competition_id for every giveaway they entered that you created. Note: it will not return giveaways they entered that were created by other hosts.<\/p>\n<p><code>GET https:\/\/sweepwidgetapi.com\/sw_api\/user-entered-giveaways<\/code><\/p>\n<h4 id=\"parameters-5\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>search_value<\/td>\n<td>String<\/td>\n<td>Either the user_id or user_email of the user.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>search_key<\/td>\n<td>String<\/td>\n<td>Accepted values: user_id or user_email. You must specify if you are searching for a user by their id or email address.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-5\">Example Request<\/h4>\n<pre class=\"php\"><code>$curl = curl_init();\n \n\/\/ Example searching by the user&#39;s id\n$url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/user-entered-giveaways?search_value=123&amp;search_key=user_id&quot;;\n \n\/\/ Example searching by the user&#39;s email address\n$url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/user-entered-giveaways?search_value=example-user@email.com&amp;search_key=user_email&quot;;\n \ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; $url,\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; &quot;&quot;,\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; &quot;GET&quot;,\n  CURLOPT_HTTPHEADER =&gt; array(\n    &quot;Authorization: Bearer YOUR_API_KEY&quot;,\n    &quot;Content-Type: application\/json&quot;\n  ),\n));\n \n$response = json_decode(curl_exec($curl));\nvar_dump($response);<\/code><\/pre>\n<h4 id=\"example-response-5\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;competition_id&quot;: [&quot;20234&quot;, &quot;20165&quot;, &quot;20137&quot;, &quot;20108&quot;]\n}<\/code><\/pre>\n<p>If nothing is found, the response is <code>{\"message\": \"No results...\"}<\/code>.<\/p>\n<h3 id=\"update-whitelisted-emails\">Update whitelisted emails<\/h3>\n<p>This method replaces the whitelisted emails for a single competition. You can optionally replace the global whitelisted emails for all competitions of the brand.<\/p>\n<p>The list you send replaces the existing list. To add one email, send the full list including it.<\/p>\n<p>The list only takes effect when <strong>Only allow specific emails to enter<\/strong> is turned on for the giveaway (Security settings, or <code>if_enter_whitelist = 1<\/code> in Update a giveaway).<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/white-list-emails<\/code><\/p>\n<h4 id=\"parameters-6\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>global<\/td>\n<td>Boolean<\/td>\n<td>Specify if this is for a single giveaway or ALL giveaways of the brand. Accepted values: 1 or 0.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition. Send it on every call, including global = 1 (it must be one of your giveaways).<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>whitelisted_emails<\/td>\n<td>Array<\/td>\n<td>Specify which emails are allowed to enter.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-6\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/white-list-emails&#39;);\n \n$post = json_encode([\n  &#39;global&#39; =&gt; 0,\n  &#39;competition_id&#39; =&gt; &#39;123&#39;,\n  &#39;whitelisted_emails&#39; =&gt; array(&#39;one@test.com&#39;, &#39;two@test.com&#39;, &#39;three@test.com&#39;)\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-6\">Example Response<\/h4>\n<pre class=\"json\"><code>{&quot;message&quot;: &quot;Successfully updated whitelisted emails for competition id: 123&quot;}<\/code><\/pre>\n<h3 id=\"add-new-entry-method\">Add new entry method<\/h3>\n<p>This method allows you to add a new entry method to an existing giveaway.<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/create-entry-method<\/code><\/p>\n<h4 id=\"parameters-7\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>entry_method_type<\/td>\n<td>String<\/td>\n<td>Type of entry method. See available entry method types below.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>entry_method_handle<\/td>\n<td>String<\/td>\n<td>Title for the entry method on the outside (the title before the entrant toggles the entry method open). Max 255 characters.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>entries_worth<\/td>\n<td>Integer<\/td>\n<td>How many entries the entry method is worth (1 to 9999).<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>entry_order<\/td>\n<td>Integer<\/td>\n<td>What order the entry method appears. Default: after the last entry method.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>mandatory<\/td>\n<td>Integer<\/td>\n<td>Whether or not it is a required entry method. 1 = required, 0 = optional (default).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_link<\/td>\n<td>String<\/td>\n<td>This is either the profile handle or link depending on which one is required. Example: Instagram only requires the profile handle while Facebook requires the full link.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>input_header<\/td>\n<td>String<\/td>\n<td>Header string after the entrant toggles open the entry method. Default: the standard text for the entry method type.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>additional_instructions<\/td>\n<td>String<\/td>\n<td>Optional additional instructions (most entry methods do not use this).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>widget_display<\/td>\n<td>Integer<\/td>\n<td>1 = circle icon, 2 = square look (circle icon is the default).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>icon_color<\/td>\n<td>String<\/td>\n<td>Hex color code for icon e.g. #3b5998<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>require_verification<\/td>\n<td>Integer<\/td>\n<td>If you require the user to verify the username they performed the entry method with e.g. user must enter their Instagram username after following you.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>language<\/td>\n<td>String<\/td>\n<td>2 character language code. Default is english: en<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>daily<\/td>\n<td>String<\/td>\n<td>0 = one-time (default), 1 = daily repeat.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_level<\/td>\n<td>Integer<\/td>\n<td>1 = pre-entry\/required, 2 = bonus action (default).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_textarea<\/td>\n<td>String<\/td>\n<td>Content field (tweet text, questions, purchase config, etc.).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>input_options_1 through input_options_6<\/td>\n<td>String<\/td>\n<td>Entry method-specific options. Usage varies by type.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>timer<\/td>\n<td>Integer<\/td>\n<td>Countdown seconds before the user can submit.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>required_actions_until_unlock<\/td>\n<td>Integer<\/td>\n<td>Unlock after this many entries. 0 = off, or 1 to 99999.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>tags<\/td>\n<td>String<\/td>\n<td>Entry method tags.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>The response includes the new method&#8217;s <code>entry_id<\/code>. Save it: you need it to update or delete the entry method, and for <code>custom_fields<\/code> \/ <code>entry_id<\/code> in Submit an entry with a file upload.<\/p>\n<h4 id=\"available-entry-method-types\">Available entry method types<\/h4>\n<p>Use these values in the entry_method_type parameter.<\/p>\n<ul>\n<li><strong>Bluesky:<\/strong> bluesky_comment, bluesky_follow, bluesky_like_post, bluesky_post, bluesky_repost<\/li>\n<li><strong>Discord:<\/strong> discord_join_server, discord_server_boost, discord_server_role<\/li>\n<li><strong>Facebook:<\/strong> facebook_group_visit, facebook_page_visit, facebook_post_visit, facebook_post_visits, facebook_select_media<\/li>\n<li><strong>Instagram:<\/strong> instagram_comment_post, instagram_follow, instagram_like_post, instagram_repost, instagram_select_media, instagram_submit_post, instagram_tag_friend, instagram_view_post, instagram_visit_profile<\/li>\n<li><strong>LinkedIn:<\/strong> linkedin_follow, linkedin_follow_influencer, linkedin_share<\/li>\n<li><strong>Pinterest:<\/strong> pinterest_follow_board, pinterest_follow_user, pinterest_repin_pin, pinterest_select_board, pinterest_select_pin, pinterest_submit_board, pinterest_submit_pin, pinterest_visit_board, pinterest_visit_page, pinterest_visit_pin<\/li>\n<li><strong>Reddit:<\/strong> reddit_leave_a_comment, reddit_subscribe, reddit_visit_a_page<\/li>\n<li><strong>Snapchat:<\/strong> snapchat_follow<\/li>\n<li><strong>Telegram:<\/strong> telegram_join_channel, telegram_join_group, telegram_leave_a_comment<\/li>\n<li><strong>Threads:<\/strong> threads_comment, threads_follow, threads_repost<\/li>\n<li><strong>TikTok:<\/strong> tiktok_comment, tiktok_follow, tiktok_like, tiktok_share, tiktok_visit, tiktok_watch_video<\/li>\n<li><strong>Tumblr:<\/strong> tumblr_follow, tumblr_like_post, tumblr_reblog_post<\/li>\n<li><strong>Twitch:<\/strong> twitch_follow, twitch_subscribe<\/li>\n<li><strong>Twitter:<\/strong> twitter_follow, twitter_hashtags, twitter_retweet, twitter_select_media, twitter_tweet<\/li>\n<li><strong>X:<\/strong> x_follow, x_post, x_repost<\/li>\n<li><strong>YouTube:<\/strong> youtube_channel_subscribe, youtube_comment, youtube_like_video, youtube_submit_video, youtube_visit_channel, youtube_watch<\/li>\n<li><strong>Kick:<\/strong> kick_follow, kick_subscribe<\/li>\n<li><strong>SoundCloud:<\/strong> soundcloud_follow, soundcloud_like_song, soundcloud_listen_to_song, soundcloud_repost_song, soundcloud_submit_song<\/li>\n<li><strong>Spotify:<\/strong> spotify_follow, spotify_follow_playlist, spotify_follow_podcast, spotify_listen_to_song, spotify_save<\/li>\n<li><strong>Vimeo:<\/strong> vimeo_watch_video<\/li>\n<li><strong>Bandcamp:<\/strong> bandcamp_follow<\/li>\n<li><strong>Crypto Wallets:<\/strong> bep2_crypto_wallet, btc_crypto_wallet, eth_bep20_crypto_wallet, other_crypto_wallet, solana_crypto_wallet<\/li>\n<li><strong>Crowdfunding:<\/strong> indiegogo_visit, kickstarter_visit<\/li>\n<li><strong>Commerce:<\/strong> ebay_follow, entries_for_purchase, etsy_follow, etsy_item, make_a_purchase, shopify_follow, shopify_template, woocommerce_purchases<\/li>\n<li><strong>Content Platforms:<\/strong> blog_comment, disqus_comment, goodreads_add_to_shelf, goodreads_follow, medium_clap, medium_comment, patreon_page_visit, producthunt_follow, producthunt_vote, rss, substack_subscribe<\/li>\n<li><strong>Events:<\/strong> add_to_calendar, attend_eventbrite_event, attend_eventbrite_venue<\/li>\n<li><strong>Actions:<\/strong> app_download, bonus, custom, e_signature, email_subscribe, leave_a_review, loyalty_bonus, podcast_subscribe, refer_friends, secret_code, steam_join_group, upload_a_file, visit_a_page<\/li>\n<li><strong>Form Fields:<\/strong> address, birthday, checkbox, checkboxes, complete_survey, full_name, phone_number, radio, select, text_input, textarea<\/li>\n<\/ul>\n<h4 id=\"example-request-7\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/create-entry-method&#39;);\n \n$post = json_encode([\n  &#39;competition_id&#39; =&gt; &#39;123&#39;,\n  &#39;entry_order&#39; =&gt; &#39;5&#39;,\n  &#39;entry_method_type&#39; =&gt; &#39;facebook_page_visit&#39;,\n  &#39;entry_method_handle&#39; =&gt; &#39;Visit Us On Facebook&#39;,\n  &#39;mandatory&#39; =&gt; &#39;0&#39;,\n  &#39;entries_worth&#39; =&gt; &#39;10&#39;,\n  &#39;entry_link&#39; =&gt; &#39;https:\/\/facebook.com\/SweepWidget&#39;,\n  &#39;input_header&#39; =&gt; &#39;Visit and follow SweepWidget on Facebook by manually clicking on the button below.&#39;,\n  &#39;additional_instructions&#39; =&gt; &#39;&#39;,\n  &#39;widget_display&#39; =&gt; &#39;1&#39;,\n  &#39;icon_color&#39; =&gt; &#39;#3b5998&#39;,\n  &#39;require_verification&#39; =&gt; &#39;1&#39;,\n  &#39;language&#39; =&gt; &#39;en&#39;\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-7\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;message&quot;: &quot;Successfully added entry method for competition id: 123&quot;,\n  &quot;entry_id&quot;: 5,\n  &quot;entry_method&quot;: 12,\n  &quot;entry_method_type&quot;: &quot;facebook_page_visit&quot;\n}<\/code><\/pre>\n<h3 id=\"update-an-entry-method\">Update an entry method<\/h3>\n<p>This method allows you to update an existing entry method on a giveaway. Only the fields you include in the request will be updated \u2013 all other fields remain unchanged.<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/update-entry-method<\/code><\/p>\n<h4 id=\"parameters-8\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>entry_method_id<\/td>\n<td>Integer<\/td>\n<td>The entry_id of the entry method to update. It is returned when you create the entry method (Add new entry method).<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>entries_worth<\/td>\n<td>Integer<\/td>\n<td>How many entries the entry method is worth (1 to 9999).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_method_handle<\/td>\n<td>String<\/td>\n<td>Title for the entry method (the text shown before the entrant opens it).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_link<\/td>\n<td>String<\/td>\n<td>Profile handle or link for the entry method.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_title<\/td>\n<td>String<\/td>\n<td>Internal title\/label for the entry method.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>mandatory<\/td>\n<td>Integer<\/td>\n<td>Whether it is a required entry method. 1 = required, 0 = optional.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>daily<\/td>\n<td>String<\/td>\n<td>0 = one-time, 1 = daily repeat.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>additional_instructions<\/td>\n<td>String<\/td>\n<td>Additional instructions shown to the entrant.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>icon_color<\/td>\n<td>String<\/td>\n<td>Hex color code for the icon, e.g. #3b5998.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>widget_display<\/td>\n<td>Integer<\/td>\n<td>1 = circle icon (default), 2 = square look.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>require_verification<\/td>\n<td>Integer<\/td>\n<td>1 = require username verification, 0 = no verification.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_textarea<\/td>\n<td>String<\/td>\n<td>Content field (tweet text, questions, purchase config, etc.).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>input_header_value<\/td>\n<td>String<\/td>\n<td>Header text shown after the entrant opens the entry method.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>input_options_1 through input_options_6<\/td>\n<td>String<\/td>\n<td>Entry method-specific options. Usage varies by type.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>timer<\/td>\n<td>Integer<\/td>\n<td>Countdown seconds before the user can submit.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_order<\/td>\n<td>Integer<\/td>\n<td>Display order of the entry method.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_level<\/td>\n<td>Integer<\/td>\n<td>1 = pre-entry\/required, 2 = bonus action.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>required_actions_until_unlock<\/td>\n<td>Integer<\/td>\n<td>Unlock after this many entries. 0 = off, or 1 to 99999.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>tags<\/td>\n<td>String<\/td>\n<td>Entry method tags.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>email_integration<\/td>\n<td>String<\/td>\n<td>Email provider integration config.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-8\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/update-entry-method&#39;);\n \n$post = json_encode([\n  &#39;competition_id&#39; =&gt; &#39;123&#39;,\n  &#39;entry_method_id&#39; =&gt; &#39;5&#39;,\n  &#39;entries_worth&#39; =&gt; &#39;20&#39;,\n  &#39;entry_method_handle&#39; =&gt; &#39;Follow Us On Instagram&#39;,\n  &#39;mandatory&#39; =&gt; &#39;1&#39;\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-8\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;message&quot;: &quot;Successfully updated entry method 5 for competition id: 123&quot;\n}<\/code><\/pre>\n<h3 id=\"delete-an-entry-method\">Delete an entry method<\/h3>\n<p>This method allows you to delete an entry method from an existing giveaway. Note: you cannot delete the User Details (login) entry method.<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/delete-entry-method<\/code><\/p>\n<h4 id=\"parameters-9\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>entry_method_id<\/td>\n<td>Integer<\/td>\n<td>The entry_id of the entry method to delete.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-9\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/delete-entry-method&#39;);\n \n$post = json_encode([\n  &#39;competition_id&#39; =&gt; &#39;123&#39;,\n  &#39;entry_method_id&#39; =&gt; &#39;5&#39;\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-9\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;message&quot;: &quot;Successfully deleted entry method 5 from competition id: 123&quot;\n}<\/code><\/pre>\n<h3 id=\"create-a-giveaway\">Create a giveaway<\/h3>\n<p>This method allows you to create a new giveaway. It creates the giveaway with all settings including design\/styling, security rules, and a default User Details entry method. After creation, you can add additional entry methods, prizes, and rewards using the other API endpoints.<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/create-giveaway<\/code><\/p>\n<h4 id=\"required-parameters\">Required Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>title<\/td>\n<td>String<\/td>\n<td>Giveaway title (max 500 characters).<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>start_time<\/td>\n<td>String<\/td>\n<td>Start date\/time in YYYY-MM-DD HH:MM:SS format.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>end_time<\/td>\n<td>String<\/td>\n<td>End date\/time in YYYY-MM-DD HH:MM:SS format. Must be after start_time.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"basic-settings-optional\">Basic Settings (optional)<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>time_zone<\/td>\n<td>String<\/td>\n<td>America\/New_York<\/td>\n<td>PHP timezone identifier (e.g. America\/Chicago, Europe\/London).<\/td>\n<\/tr>\n<tr>\n<td>description<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>HTML description of the giveaway.<\/td>\n<\/tr>\n<tr>\n<td>rules<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>HTML rules\/terms for the giveaway.<\/td>\n<\/tr>\n<tr>\n<td>number_of_winners<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Number of winners (1-1000).<\/td>\n<\/tr>\n<tr>\n<td>language<\/td>\n<td>String<\/td>\n<td>en<\/td>\n<td>2-character language code.<\/td>\n<\/tr>\n<tr>\n<td>is_draft<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>1 = save as draft, 0 = publish.<\/td>\n<\/tr>\n<tr>\n<td>public_or_private<\/td>\n<td>String<\/td>\n<td>Brand default<\/td>\n<td>public or private. If omitted, the brand&#8217;s default setting for new giveaways is used.<\/td>\n<\/tr>\n<tr>\n<td>competition_type<\/td>\n<td>String<\/td>\n<td>standard<\/td>\n<td>standard or photo_contest.<\/td>\n<\/tr>\n<tr>\n<td>redirect_url<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Post-entry redirect URL.<\/td>\n<\/tr>\n<tr>\n<td>redirect_delay<\/td>\n<td>Integer<\/td>\n<td>5<\/td>\n<td>Seconds to wait before the redirect.<\/td>\n<\/tr>\n<tr>\n<td>entry_award_mode<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>1 = award entries per entry method, 2 = award entries only after all entry methods are completed.<\/td>\n<\/tr>\n<tr>\n<td>global_entry_amount<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Entries awarded when entry_award_mode = 2.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"entrypoints-system-optional\">Entry\/Points System (optional)<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>entries_or_points<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>1 = entries, 2 = points.<\/td>\n<\/tr>\n<tr>\n<td>entries_or_points_custom_singular<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Custom singular label (e.g. &#8220;Token&#8221;).<\/td>\n<\/tr>\n<tr>\n<td>entries_or_points_custom_plural<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Custom plural label (e.g. &#8220;Tokens&#8221;).<\/td>\n<\/tr>\n<tr>\n<td>user_details_entries_worth<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Entries awarded for completing the login form.<\/td>\n<\/tr>\n<tr>\n<td>show_prizes<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Show prizes section (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>show_rules_expanded<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Auto-expand rules section (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>hide_entries_if_logged_out<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Hide entry methods until user logs in (0\/1).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"leaderboard-optional\">Leaderboard (optional)<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>if_leaderboard<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Enable leaderboard (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>leaderboard_title<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Leaderboard title.<\/td>\n<\/tr>\n<tr>\n<td>leaderboard_description<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Leaderboard description.<\/td>\n<\/tr>\n<tr>\n<td>leaderboard_display_amount<\/td>\n<td>Integer<\/td>\n<td>10<\/td>\n<td>Number of leaders to show (max 500).<\/td>\n<\/tr>\n<tr>\n<td>leaderboard_name_display<\/td>\n<td>Integer<\/td>\n<td>4<\/td>\n<td>1 = full name, 2 = full first name and last initial, 3 = first initial and full last name, 4 = aliased name (1st place user, 2nd place user, etc.).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"unlock-rewards-optional\">Unlock rewards (optional)<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>if_unlock_rewards<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Enable unlock rewards (0\/1). Adding a reward with Add an unlock reward turns this on automatically.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"login-fields-optional\">Login Fields (optional)<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>required_main_login_options<\/td>\n<td>String<\/td>\n<td>1,1,0<\/td>\n<td>CSV: name,email,phone (1 = required, 0 = not required).<\/td>\n<\/tr>\n<tr>\n<td>social_login_require<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Require social login (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>social_login_options<\/td>\n<td>String<\/td>\n<td>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0<\/td>\n<td>CSV of 15 toggles: Facebook, Twitter, Instagram, Pinterest, Google, LinkedIn, Twitch, Discord, Steam, Yahoo, Tumblr, OpenID, Telegram, Reddit, Spotify.<\/td>\n<\/tr>\n<tr>\n<td>require_entry_method_before_login<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Show entry methods before login form (0\/1).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"security-optional\">Security (optional)<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>security_level<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>0 = weak, 1 = standard, 2 = strong, 3 = strict.<\/td>\n<\/tr>\n<tr>\n<td>require_captcha<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Not used: giveaways don&#8217;t show a CAPTCHA, whatever the value.<\/td>\n<\/tr>\n<tr>\n<td>check_for_duplicate_ip<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Block duplicate IP addresses (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>block_vpns<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Block VPN users (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>block_high_risk_email_tld<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>No extra effect (0\/1). Disposable email addresses are blocked on every giveaway.<\/td>\n<\/tr>\n<tr>\n<td>age_limit<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>0 = no limit, otherwise the age requirement.<\/td>\n<\/tr>\n<tr>\n<td>age_limit_min_or_max<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>1 = minimum age, 2 = maximum age.<\/td>\n<\/tr>\n<tr>\n<td>countries_allowed<\/td>\n<td>String<\/td>\n<td>Worldwide<\/td>\n<td>Legacy field. For geo-targeting, use geo_mode, geo_countries_iso, and geo_states instead (see below).<\/td>\n<\/tr>\n<tr>\n<td>countries_allowed_include_or_exclude<\/td>\n<td>String<\/td>\n<td>include<\/td>\n<td>include or exclude.<\/td>\n<\/tr>\n<tr>\n<td>geo_mode<\/td>\n<td>String<\/td>\n<td>off<\/td>\n<td>Geo-targeting mode: &#8220;off&#8221; (disabled), &#8220;allow&#8221; (only allow listed locations), or &#8220;block&#8221; (block listed locations). Premium plan required.<\/td>\n<\/tr>\n<tr>\n<td>geo_countries_iso<\/td>\n<td>String<\/td>\n<td><\/td>\n<td>Comma-separated ISO 3166-1 alpha-2 country codes, e.g. &#8220;US,CA,GB&#8221;. Used with geo_mode.<\/td>\n<\/tr>\n<tr>\n<td>geo_states<\/td>\n<td>String<\/td>\n<td><\/td>\n<td>JSON object for US state-level targeting. Format: {&#8220;US&#8221;:[&#8220;CA&#8221;,&#8221;NY&#8221;,&#8221;TX&#8221;]}. Only applicable when geo_countries_iso includes &#8220;US&#8221;.<\/td>\n<\/tr>\n<tr>\n<td>max_allowed_users_to_enter<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Max participants (0 = unlimited).<\/td>\n<\/tr>\n<tr>\n<td>max_allowed_entries<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Max total entries across all users (0 = unlimited).<\/td>\n<\/tr>\n<tr>\n<td>entries_allowed_per_user<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Max entries per user (0 = unlimited).<\/td>\n<\/tr>\n<tr>\n<td>require_verify_email<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Require email verification (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>if_enter_whitelist<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Turn on &#8220;Only allow specific emails to enter&#8221; (0\/1). Set the list with Update whitelisted emails.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"designstyling-optional\">Design\/Styling (optional)<\/h4>\n<p>All color values are 6-character hex codes without the # symbol (e.g. 333333).<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>widget_position<\/td>\n<td>Integer<\/td>\n<td>2<\/td>\n<td>1 = left, 2 = center, 3 = right.<\/td>\n<\/tr>\n<tr>\n<td>title_font_color<\/td>\n<td>String<\/td>\n<td>555555<\/td>\n<td>Title text color.<\/td>\n<\/tr>\n<tr>\n<td>title_font_size<\/td>\n<td>Integer<\/td>\n<td>24<\/td>\n<td>Title font size in px.<\/td>\n<\/tr>\n<tr>\n<td>body_font_color<\/td>\n<td>String<\/td>\n<td>555555<\/td>\n<td>Body text color.<\/td>\n<\/tr>\n<tr>\n<td>body_background_color<\/td>\n<td>String<\/td>\n<td>ffffff<\/td>\n<td>Body background color.<\/td>\n<\/tr>\n<tr>\n<td>body_description_background_color<\/td>\n<td>String<\/td>\n<td>ffffff<\/td>\n<td>Description background color.<\/td>\n<\/tr>\n<tr>\n<td>body_font_size<\/td>\n<td>Integer<\/td>\n<td>16<\/td>\n<td>Body font size in px.<\/td>\n<\/tr>\n<tr>\n<td>buttons_font_color<\/td>\n<td>String<\/td>\n<td>ffffff<\/td>\n<td>Button text color.<\/td>\n<\/tr>\n<tr>\n<td>buttons_background_color<\/td>\n<td>String<\/td>\n<td>4a3aff<\/td>\n<td>Button background color.<\/td>\n<\/tr>\n<tr>\n<td>buttons_font_size<\/td>\n<td>Integer<\/td>\n<td>15<\/td>\n<td>Button font size in px.<\/td>\n<\/tr>\n<tr>\n<td>buttons_width<\/td>\n<td>Integer<\/td>\n<td>150<\/td>\n<td>Button width in px.<\/td>\n<\/tr>\n<tr>\n<td>buttons_padding<\/td>\n<td>String<\/td>\n<td>10 15 10 15<\/td>\n<td>Button padding in px (top right bottom left).<\/td>\n<\/tr>\n<tr>\n<td>buttons_border_radius<\/td>\n<td>Integer<\/td>\n<td>4<\/td>\n<td>Button border radius in px.<\/td>\n<\/tr>\n<tr>\n<td>buttons_enter_text<\/td>\n<td>String<\/td>\n<td>Enter Giveaway<\/td>\n<td>Button text.<\/td>\n<\/tr>\n<tr>\n<td>form_border_color<\/td>\n<td>String<\/td>\n<td>eeeeee<\/td>\n<td>Form border color.<\/td>\n<\/tr>\n<tr>\n<td>form_border_width<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Form border width in px.<\/td>\n<\/tr>\n<tr>\n<td>form_border_radius<\/td>\n<td>Integer<\/td>\n<td>10<\/td>\n<td>Form border radius in px.<\/td>\n<\/tr>\n<tr>\n<td>form_box_shadow<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Enable form box shadow (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>form_max_width<\/td>\n<td>Integer<\/td>\n<td>600<\/td>\n<td>Max form width in px.<\/td>\n<\/tr>\n<tr>\n<td>form_font_family<\/td>\n<td>String<\/td>\n<td>Roboto<\/td>\n<td>Font family.<\/td>\n<\/tr>\n<tr>\n<td>top_background_color<\/td>\n<td>String<\/td>\n<td>ffffff<\/td>\n<td>Countdown bar background color.<\/td>\n<\/tr>\n<tr>\n<td>top_numbers_font_color<\/td>\n<td>String<\/td>\n<td>4a3aff<\/td>\n<td>Countdown numbers color.<\/td>\n<\/tr>\n<tr>\n<td>top_numbers_font_size<\/td>\n<td>Integer<\/td>\n<td>24<\/td>\n<td>Countdown numbers font size in px.<\/td>\n<\/tr>\n<tr>\n<td>top_text_font_color<\/td>\n<td>String<\/td>\n<td>777777<\/td>\n<td>Countdown text color.<\/td>\n<\/tr>\n<tr>\n<td>top_text_font_size<\/td>\n<td>Integer<\/td>\n<td>15<\/td>\n<td>Countdown text font size in px.<\/td>\n<\/tr>\n<tr>\n<td>input_border_color<\/td>\n<td>String<\/td>\n<td>c4c4c4<\/td>\n<td>Input field border color.<\/td>\n<\/tr>\n<tr>\n<td>input_border_width<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Input field border width in px.<\/td>\n<\/tr>\n<tr>\n<td>input_border_radius<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Input field border radius in px.<\/td>\n<\/tr>\n<tr>\n<td>links_font_color<\/td>\n<td>String<\/td>\n<td>4a3aff<\/td>\n<td>Link text color.<\/td>\n<\/tr>\n<tr>\n<td>unlock_font_color<\/td>\n<td>String<\/td>\n<td>555555<\/td>\n<td>Unlock text color.<\/td>\n<\/tr>\n<tr>\n<td>unlock_font_size<\/td>\n<td>Integer<\/td>\n<td>19<\/td>\n<td>Unlock text font size in px.<\/td>\n<\/tr>\n<tr>\n<td>landing_page_background_type<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Landing page background type.<\/td>\n<\/tr>\n<tr>\n<td>landing_page_background_color<\/td>\n<td>String<\/td>\n<td>ffffff<\/td>\n<td>Landing page background color.<\/td>\n<\/tr>\n<tr>\n<td>entry_methods_view<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>1 = modern view, 2 = classic view.<\/td>\n<\/tr>\n<tr>\n<td>hide_title<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Hide the giveaway title (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>hide_description<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Hide the description (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>hide_top_bottom_lines<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Hide the top and bottom lines (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>remove_footer<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Remove the &#8220;Built with SweepWidget&#8221; footer (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>if_custom_css<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Enable custom CSS (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>custom_css<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Custom CSS code.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"photo-contest-fields-optional-only-when-competition_type--photo_contest\">Photo Contest Fields (optional, only when competition_type = photo_contest)<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>gallery_title<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Gallery section title.<\/td>\n<\/tr>\n<tr>\n<td>gallery_description<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Gallery description HTML.<\/td>\n<\/tr>\n<tr>\n<td>gallery_how_winners_determined<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>1 = user voting, 2 = admin picks.<\/td>\n<\/tr>\n<tr>\n<td>gallery_votes_per_user<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Number of votes per user.<\/td>\n<\/tr>\n<tr>\n<td>gallery_require_login_to_vote<\/td>\n<td>Integer<\/td>\n<td>1<\/td>\n<td>Require login to vote (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>require_media_approval<\/td>\n<td>Integer<\/td>\n<td>0<\/td>\n<td>Require admin approval for submissions (0\/1).<\/td>\n<\/tr>\n<tr>\n<td>gallery_button_photographer_text<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Custom photographer button text.<\/td>\n<\/tr>\n<tr>\n<td>gallery_button_voter_text<\/td>\n<td>String<\/td>\n<td>(empty)<\/td>\n<td>Custom voter button text.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-10\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/create-giveaway&#39;);\n \n$post = json_encode([\n  &#39;title&#39; =&gt; &#39;Summer Giveaway 2026&#39;,\n  &#39;start_time&#39; =&gt; &#39;2026-03-01 00:00:00&#39;,\n  &#39;end_time&#39; =&gt; &#39;2026-03-31 23:59:59&#39;,\n  &#39;time_zone&#39; =&gt; &#39;America\/New_York&#39;,\n  &#39;description&#39; =&gt; &#39;Enter to win amazing prizes this summer!&#39;,\n  &#39;number_of_winners&#39; =&gt; &#39;3&#39;,\n  &#39;language&#39; =&gt; &#39;en&#39;,\n  &#39;buttons_background_color&#39; =&gt; &#39;4CAF50&#39;,\n  &#39;title_font_color&#39; =&gt; &#39;222222&#39;\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-10\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;message&quot;: &quot;Successfully created giveaway.&quot;,\n  &quot;competition_id&quot;: 12345,\n  &quot;competition_url&quot;: &quot;a1b2c3d4&quot;,\n  &quot;giveaway_link&quot;: &quot;https:\/\/sweepwidget.com\/view\/12345-a1b2c3d4&quot;,\n  &quot;embed_code&quot;: &quot;&lt;div id=\\&quot;12345-a1b2c3d4\\&quot; class=\\&quot;sw_container\\&quot;&gt;&lt;\/div&gt;&lt;script type=\\&quot;text\/javascript\\&quot; src=\\&quot;https:\/\/sweepwidget.com\/w\/j\/w_init.js\\&quot;&gt;&lt;\/script&gt;&quot;\n}<\/code><\/pre>\n<h3 id=\"update-a-giveaway\">Update a giveaway<\/h3>\n<p>This method allows you to update an existing giveaway. Only the fields you include in the request will be updated \u2013 all other settings remain unchanged. You can update settings across the main giveaway, security\/rules, and design\/styling.<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/update-giveaway<\/code><\/p>\n<h4 id=\"parameters-10\">Parameters<\/h4>\n<p>The following parameters are required. All other parameters from the Create a giveaway endpoint are accepted as optional \u2013 only fields you include will be updated.<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-11\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/update-giveaway&#39;);\n \n$post = json_encode([\n  &#39;competition_id&#39; =&gt; &#39;12345&#39;,\n  &#39;title&#39; =&gt; &#39;Updated Giveaway Title&#39;,\n  &#39;end_time&#39; =&gt; &#39;2026-04-15 23:59:59&#39;,\n  &#39;buttons_background_color&#39; =&gt; &#39;FF5722&#39;\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-11\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;message&quot;: &quot;Successfully updated giveaway 12345.&quot;\n}<\/code><\/pre>\n<h3 id=\"delete-a-giveaway\">Delete a giveaway<\/h3>\n<p>This method allows you to delete a giveaway. The giveaway is soft-deleted (it can be recovered by contacting support).<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/delete-giveaway<\/code><\/p>\n<h4 id=\"parameters-11\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-12\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/delete-giveaway&#39;);\n \n$post = json_encode([\n  &#39;competition_id&#39; =&gt; &#39;12345&#39;\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-12\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;message&quot;: &quot;Successfully deleted giveaway 12345.&quot;\n}<\/code><\/pre>\n<p>If the giveaway is not found or was already deleted, the response is <code>{\"message\": \"Giveaway not found or already deleted.\"}<\/code>.<\/p>\n<h3 id=\"add-a-prize-to-a-giveaway\">Add a prize to a giveaway<\/h3>\n<p>This method allows you to add a prize to an existing giveaway. After adding a prize, the giveaway&#8217;s total number of winners is automatically updated to match the sum of all prize winner counts.<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/create-prize<\/code><\/p>\n<h4 id=\"parameters-12\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>prize_name<\/td>\n<td>String<\/td>\n<td>Name of the prize.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>prize_winners_allowed<\/td>\n<td>Integer<\/td>\n<td>Number of winners for this prize. Default: 1.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>prize_value<\/td>\n<td>String<\/td>\n<td>Monetary value of the prize (e.g. &#8220;50.00&#8221;).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>prize_currency<\/td>\n<td>String<\/td>\n<td>3-character currency code. Default: USD.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>redemption_switch<\/td>\n<td>Integer<\/td>\n<td>Enable redemption codes for winners (0\/1). Default: 0.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>redemption_codes<\/td>\n<td>String<\/td>\n<td>Comma-separated redemption codes for winners.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>redemption_instructions<\/td>\n<td>String<\/td>\n<td>HTML instructions shown to winners.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>redemption_subject<\/td>\n<td>String<\/td>\n<td>Email subject line for winner notification.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>redemption_reply_to_email<\/td>\n<td>String<\/td>\n<td>Reply-to email address for winner notification.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>redemption_reply_to_name<\/td>\n<td>String<\/td>\n<td>Reply-to name for winner notification.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-13\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/create-prize&#39;);\n \n$post = json_encode([\n  &#39;competition_id&#39; =&gt; &#39;12345&#39;,\n  &#39;prize_name&#39; =&gt; &#39;$100 Amazon Gift Card&#39;,\n  &#39;prize_winners_allowed&#39; =&gt; &#39;1&#39;,\n  &#39;prize_value&#39; =&gt; &#39;100.00&#39;,\n  &#39;prize_currency&#39; =&gt; &#39;USD&#39;\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-13\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;message&quot;: &quot;Successfully added prize to competition id: 12345&quot;,\n  &quot;prize_id&quot;: 1,\n  &quot;prize_order&quot;: 1\n}<\/code><\/pre>\n<h3 id=\"add-an-unlock-reward-to-a-giveaway\">Add an unlock reward to a giveaway<\/h3>\n<p>This method allows you to add an unlock reward (milestone reward or instant coupon) to a giveaway. When a user earns enough entries, they automatically unlock the reward. Adding a reward automatically enables the unlock rewards feature on the giveaway.<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/create-reward<\/code><\/p>\n<h4 id=\"parameters-13\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_type<\/td>\n<td>Integer<\/td>\n<td>1 = prize draw entry, 2 = coupon.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_title<\/td>\n<td>String<\/td>\n<td>Name\/title of the reward.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_entries_required<\/td>\n<td>Integer<\/td>\n<td>Number of entries the user must earn to unlock this reward (1 to 9999).<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_hide_progress<\/td>\n<td>Integer<\/td>\n<td>Hide the progress bar from users (0\/1). Default: 0.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_prize_random_or_guaranteed<\/td>\n<td>Integer<\/td>\n<td>1 = random drawing, 2 = guaranteed. Default: 1. Coupons are always guaranteed.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_coupon_code<\/td>\n<td>String<\/td>\n<td>Coupon code(s), comma-separated for multiple codes.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_coupon_directions<\/td>\n<td>String<\/td>\n<td>HTML instructions for redeeming the coupon.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_if_send_email<\/td>\n<td>Integer<\/td>\n<td>1 = no email, 2 = default email, 3 = custom email. Default: 1.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_user_email_subject<\/td>\n<td>String<\/td>\n<td>Custom email subject line. Supports [NAME_OF_COUPON] placeholder.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_user_email_body<\/td>\n<td>String<\/td>\n<td>Custom email body HTML.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_user_email_reply_to_email<\/td>\n<td>String<\/td>\n<td>Reply-to email. Default: <a href=\"mailto:noreply@sweepwidget.co\">noreply@sweepwidget.co<\/a>.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>unlock_rewards_user_email_reply_to_name<\/td>\n<td>String<\/td>\n<td>Reply-to name. Default: SweepWidget.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-14\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/create-reward&#39;);\n \n$post = json_encode([\n  &#39;competition_id&#39; =&gt; &#39;12345&#39;,\n  &#39;unlock_rewards_type&#39; =&gt; &#39;2&#39;,\n  &#39;unlock_rewards_title&#39; =&gt; &#39;10% Off Coupon&#39;,\n  &#39;unlock_rewards_entries_required&#39; =&gt; &#39;5&#39;,\n  &#39;unlock_rewards_coupon_code&#39; =&gt; &#39;SAVE10&#39;,\n  &#39;unlock_rewards_coupon_directions&#39; =&gt; &#39;Use code SAVE10 at checkout.&#39;,\n  &#39;unlock_rewards_if_send_email&#39; =&gt; &#39;2&#39;\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-14\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;message&quot;: &quot;Successfully added reward to competition id: 12345&quot;,\n  &quot;unlock_rewards_id&quot;: 1,\n  &quot;unlock_rewards_order&quot;: 1\n}<\/code><\/pre>\n<h3 id=\"add-manual-entries-for-a-user\">Add manual entries for a user<\/h3>\n<p>This method allows you to add manual entries for a user. The user must already be entered into your giveaway to add entries. For example, if there is a user who has already entered your contest under the email <a href=\"mailto:john.doe@example.com\">john.doe@example.com<\/a>, you can manually add 1-10,000 entries for this user.<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/add-manual-entries<\/code><\/p>\n<h4 id=\"parameters-14\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>entry_amount<\/td>\n<td>Integer<\/td>\n<td>How many entries you are giving to this user.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>user_email<\/td>\n<td>String<\/td>\n<td>The email address of the user. Note: the user must already be entered into your contest.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>custom_identifier<\/td>\n<td>String<\/td>\n<td>Your own external reference ID for this participant (max 255 characters). Updates the identifier for this user in this giveaway.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-15\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/add-manual-entries&#39;);\n \n$post = json_encode([\n  &#39;competition_id&#39; =&gt; &#39;123&#39;,\n  &#39;entry_amount&#39; =&gt; &#39;1&#39;,\n  &#39;user_email&#39; =&gt; &#39;john.doe@example.com&#39;\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-15\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;success&quot;: true,\n  &quot;message&quot;: &quot;Entries successfully added.&quot;,\n  &quot;user_email&quot;: &quot;john.doe@example.com&quot;,\n  &quot;entries_added&quot;: &quot;1&quot;,\n  &quot;competition_id&quot;: &quot;123&quot;\n}<\/code><\/pre>\n<p>If the email has not entered the giveaway, the response is <code>{\"message\": \"There is no user associated with this email.\"}<\/code>.<\/p>\n<h3 id=\"enter-user-into-a-giveaway\">Enter user into a giveaway<\/h3>\n<p>This method allows you to enter a user into your giveaway using the API.<\/p>\n<p><code>POST https:\/\/sweepwidgetapi.com\/sw_api\/new-entry<\/code><\/p>\n<p>Good to know:<\/p>\n<ul>\n<li>Each email can enter a giveaway once. A second call with the same email returns <code>{\"message\": \"This user has already entered this competition.\"}<\/code>. To give that user more entries, use Add manual entries for a user.<\/li>\n<li>The API does not check the giveaway&#8217;s start time, end time or draft status. Only send entries while your giveaway is running.<\/li>\n<li>If the email has entered one of your giveaways before, the existing participant is reused and the name you send is not applied.<\/li>\n<li>Entries added with this endpoint do not fire webhooks.<\/li>\n<\/ul>\n<h4 id=\"parameters-15\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>user_email<\/td>\n<td>String<\/td>\n<td>Email of the user.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>user_name<\/td>\n<td>String<\/td>\n<td>Name of the user.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>entry_amount<\/td>\n<td>Integer<\/td>\n<td>How many entries is this worth?<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>giveaway_link<\/td>\n<td>String<\/td>\n<td>Full URL to where the giveaway is located. Example: <a href=\"https:\/\/yoursite.com\/path-to-your-giveaway\">https:\/\/yoursite.com\/path-to-your-giveaway<\/a>. Note: you must include the website protocol (http:\/\/ or https:\/\/).<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>sw_share<\/td>\n<td>String<\/td>\n<td>The share hash from the referral link. Fetch this value from the sw-share GET variable in your URL. Example: if the URL is <a href=\"https:\/\/yourwebsite.com\/giveaway?sw-share=12345-asfdjhwe\">https:\/\/yourwebsite.com\/giveaway?sw-share=12345-asfdjhwe<\/a>, pass 12345-asfdjhwe as the value. Only pass this parameter when the share hash is present in the URL. Note: a refer a friend entry method must exist on the giveaway for referral tracking to work.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>custom_identifier<\/td>\n<td>String<\/td>\n<td>Your own external reference ID for this participant (max 255 characters). This value is returned in entry, user, and winner responses.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-16\">Example Request<\/h4>\n<pre class=\"php\"><code>$ch = curl_init(&#39;https:\/\/sweepwidgetapi.com\/sw_api\/new-entry&#39;);\n \n$post = json_encode([\n  &#39;competition_id&#39; =&gt; &#39;123&#39;,\n  &#39;user_email&#39; =&gt; &#39;test@example.com&#39;,\n  &#39;user_name&#39; =&gt; &#39;Test User&#39;,\n  &#39;entry_amount&#39; =&gt; &#39;1&#39;,\n  &#39;giveaway_link&#39; =&gt; &#39;https:\/\/example.com\/path-to-my-giveaway&#39;,\n  \/\/&#39;sw_share&#39; =&gt; &#39;8u84os-12345&#39;, \/\/ Only pass if the referral link is set\n  \/\/&#39;custom_identifier&#39; =&gt; &#39;your-reference-id&#39; \/\/ Optional: your own external reference\n]);\n \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n  &#39;Authorization: Bearer YOUR_API_KEY&#39;,\n  &#39;Content-Type: application\/json&#39;\n]);\n \n$response = curl_exec($ch);\ncurl_close($ch);<\/code><\/pre>\n<h4 id=\"example-response-16\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;message&quot;: &quot;You have successfully entered Test User (test@example.com)&quot;,\n  &quot;user_id&quot;: &quot;a1b2c3d4-e5f6-7890-abcd-ef1234567890&quot;\n}<\/code><\/pre>\n<h3 id=\"fetch-referral-link-for-a-user\">Fetch referral link for a user<\/h3>\n<p>This method allows you to fetch a user&#8217;s referral link for one of your giveaways. The user must have entered that giveaway.<\/p>\n<p><code>GET https:\/\/sweepwidgetapi.com\/sw_api\/fetch-user-referral-link<\/code><\/p>\n<h4 id=\"parameters-16\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>ID of your competition.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>user_email<\/td>\n<td>String<\/td>\n<td>Email of the user.<\/td>\n<td>Required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"example-request-17\">Example Request<\/h4>\n<pre class=\"php\"><code>$curl = curl_init();\n \n$url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/fetch-user-referral-link?competition_id=123&amp;user_email=user@example.com&quot;;\n \ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; $url,\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_ENCODING =&gt; &quot;&quot;,\n  CURLOPT_MAXREDIRS =&gt; 10,\n  CURLOPT_TIMEOUT =&gt; 30,\n  CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST =&gt; &quot;GET&quot;,\n  CURLOPT_HTTPHEADER =&gt; array(\n    &quot;Authorization: Bearer YOUR_API_KEY&quot;,\n    &quot;Content-Type: application\/json&quot;\n  ),\n));\n \n$response = json_decode(curl_exec($curl));\nvar_dump($response);<\/code><\/pre>\n<h4 id=\"example-response-17\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;landing_page&quot;: &quot;https:\/\/yoursite.com\/giveaway?sw-share=12345-asfdjhwe&quot;\n}<\/code><\/pre>\n<p>If no referral link is found, the response is <code>{\"message\": \"No results...\"}<\/code>.<\/p>\n<h3 id=\"submit-an-entry-with-a-file-upload\">Submit an entry with a file upload<\/h3>\n<p>This method allows you to submit an entry with a photo or video file for a giveaway that has an Upload A File entry method (this includes photo contests). The file is validated and stored the same way a widget upload is, thumbnails are generated automatically, and the participant is credited the entry amount configured on the entry method. If the participant doesn&#8217;t exist yet, they are created automatically. This is perfect for building your own entry form with a file upload field.<\/p>\n<p><code>POST https:\/\/sweepwidget.com\/sw_api\/upload-entry<\/code><\/p>\n<p>Note: this endpoint uses the URL above (on sweepwidget.com), and the request must be sent as multipart\/form-data (not JSON) because it carries a file.<\/p>\n<h4 id=\"parameters-17\">Parameters<\/h4>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<th>Required<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>api_key<\/td>\n<td>String<\/td>\n<td>API developer key. Can also be sent as Authorization: Bearer header.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>competition_id<\/td>\n<td>Integer<\/td>\n<td>The unique ID of the giveaway.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>user_email<\/td>\n<td>String<\/td>\n<td>The email address of the participant.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>file_upload<\/td>\n<td>File<\/td>\n<td>The photo or video file, sent as multipart\/form-data. Allowed file types are the ones configured on the giveaway&#8217;s Upload A File entry method. Max size: 100 MB.<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>user_name<\/td>\n<td>String<\/td>\n<td>The name of the participant. Required if the participant has not entered any of your giveaways before.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>caption<\/td>\n<td>String<\/td>\n<td>A gallery caption shown with the submission (max 1,000 characters).<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>entry_id<\/td>\n<td>Integer<\/td>\n<td>If the giveaway has more than one Upload A File entry method, the entry method to credit. Defaults to the first one.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>custom_identifier<\/td>\n<td>String<\/td>\n<td>A custom identifier stored with the participant.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>user_phone<\/td>\n<td>String<\/td>\n<td>The participant&#8217;s phone number, stored on their profile.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<tr>\n<td>custom_fields<\/td>\n<td>JSON object<\/td>\n<td>Values for the giveaway&#8217;s custom form field entry methods, as a JSON object mapping each entry method&#8217;s entry_id to the participant&#8217;s answer, e.g. {&#8220;4&#8221;: &#8220;Supermarket&#8221;, &#8220;5&#8221;: &#8220;2&#8221;}. Each saved field credits that entry method&#8217;s configured entry amount.<\/td>\n<td>Optional<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h4 id=\"good-to-know\">Good to know<\/h4>\n<ul>\n<li>Each participant can submit one file per Upload A File entry method, unless the entry method has daily re-entry enabled.<\/li>\n<li>If the giveaway requires media approval, the submission is created as pending and won&#8217;t show in the gallery until you approve it.<\/li>\n<li>If the gallery has &#8220;Allow participants to submit their own entries?&#8221; set to No, the call returns &#8220;Submissions are turned off for this contest.&#8221;<\/li>\n<li>Images are resized into gallery thumbnails automatically. Videos get a frame extracted as their thumbnail.<\/li>\n<li>The response includes the CDN URL of the stored file and its thumbnail.<\/li>\n<li>To pass values for custom form fields (text inputs, dropdowns, dates, etc.), add those entry methods to your giveaway, then send their values via custom_fields. Use the <code>entry_id<\/code> returned when you create the entry method with Add new entry method. The List all entries response does not include entry_id.<\/li>\n<\/ul>\n<h4 id=\"example-request-18\">Example Request<\/h4>\n<pre><code>curl -X POST &quot;https:\/\/sweepwidget.com\/sw_api\/upload-entry&quot; \\\n  -H &quot;Authorization: Bearer YOUR_API_KEY&quot; \\\n  -F &quot;competition_id=123&quot; \\\n  -F &quot;user_email=jane@example.com&quot; \\\n  -F &quot;user_name=Jane Smith&quot; \\\n  -F &quot;user_phone=+64211234567&quot; \\\n  -F &quot;caption=My receipt&quot; \\\n  -F &#39;custom_fields={&quot;4&quot;: &quot;Supermarket&quot;, &quot;5&quot;: &quot;2&quot;, &quot;6&quot;: &quot;24\/08\/2026&quot;}&#39; \\\n  -F &quot;file_upload=@\/path\/to\/receipt.jpg&quot;<\/code><\/pre>\n<pre class=\"php\"><code>$curl = curl_init();\n \ncurl_setopt_array($curl, array(\n  CURLOPT_URL =&gt; &quot;https:\/\/sweepwidget.com\/sw_api\/upload-entry&quot;,\n  CURLOPT_RETURNTRANSFER =&gt; true,\n  CURLOPT_CUSTOMREQUEST =&gt; &quot;POST&quot;,\n  CURLOPT_POSTFIELDS =&gt; array(\n    &quot;competition_id&quot; =&gt; 123,\n    &quot;user_email&quot; =&gt; &quot;jane@example.com&quot;,\n    &quot;user_name&quot; =&gt; &quot;Jane Smith&quot;,\n    &quot;caption&quot; =&gt; &quot;My sunset photo&quot;,\n    &quot;file_upload&quot; =&gt; new CURLFile(&quot;\/path\/to\/photo.jpg&quot;)\n  ),\n  CURLOPT_HTTPHEADER =&gt; array(\n    &quot;Authorization: Bearer YOUR_API_KEY&quot;\n  ),\n));\n \n$response = json_decode(curl_exec($curl));\nvar_dump($response);<\/code><\/pre>\n<h4 id=\"example-response-18\">Example Response<\/h4>\n<pre class=\"json\"><code>{\n  &quot;success&quot;: true,\n  &quot;message&quot;: &quot;Entry with file upload successfully added.&quot;,\n  &quot;competition_id&quot;: 123,\n  &quot;user_id&quot;: &quot;a1b2c3d4-e5f6-7890-abcd-ef1234567890&quot;,\n  &quot;user_email&quot;: &quot;jane@example.com&quot;,\n  &quot;entry_id&quot;: 3,\n  &quot;entries_added&quot;: 4,\n  &quot;custom_fields_saved&quot;: [4, 5, 6],\n  &quot;file_url&quot;: &quot;https:\/\/sweepwidgetuploads.fra1.cdn.digitaloceanspaces.com\/competition\/123\/9f2c1b7e.jpg&quot;,\n  &quot;thumbnail_url&quot;: &quot;https:\/\/sweepwidgetuploads.fra1.cdn.digitaloceanspaces.com\/competition\/123\/9f2c1b7e.jpg&quot;,\n  &quot;media_status&quot;: &quot;approved&quot;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The SweepWidget API allows you to read and write data to your giveaways. If you need any specific functionality that is not currently available, feel free to contact support. Plan: The API is available on the Enterprise plan only. On other plans the API key is hidden and every call returns {&#8220;message&#8221;:&#8221;API access not allowed.&#8221;}. Base URL https:\/\/sweepwidgetapi.com\/sw_api\/ Getting Your API Key Click Integrations in the left sidebar. Click the SweepWidget API card. Copy the key in the API Key field. Each brand has its own API key. The page shows the key of the brand you have selected, and that brand must be on the Enterprise plan. Authentication All API requests require authentication using your API key. Send your API key as a Bearer token in the Authorization header: Authorization: Bearer YOUR_API_KEY Backward compatible: you can also pass api_key as a query parameter (GET) or form field (POST). Both methods are supported. How to make requests GET endpoints (reading data): Pass parameters as query string values in the URL. GET https:\/\/sweepwidgetapi.com\/sw_api\/users?competition_id=123&amp;page_start=1 Authorization: Bearer YOUR_API_KEY POST endpoints (writing data): Send parameters in the request body as JSON. Set the Content-Type header to application\/json. POST https:\/\/sweepwidgetapi.com\/sw_api\/new-entry Authorization: Bearer YOUR_API_KEY Content-Type: application\/json { &quot;competition_id&quot;: 123, &quot;user_name&quot;: &quot;Jane&quot;, &quot;user_email&quot;: &quot;jane@example.com&quot;, &quot;entry_amount&quot;: 1, &quot;giveaway_link&quot;: &quot;https:\/\/yoursite.com&quot; } Important: For POST endpoints, parameters must be sent in the request body, not in the URL. Putting POST parameters in the URL query string (e.g. \/new-entry?competition_id=123&amp;user_email=&#8230;) will not work. Rate limit Send no more than 1 request per second. Faster calls are rejected with: {&quot;message&quot;: &quot;RATE LIMIT! You are only allowed 1 API call per second.&quot;} Rejected calls also count toward the limit, so wait a second before you retry. Errors Errors are returned with HTTP status 200 and a JSON body with a message field. Check for message in every response. Common messages: Message Meaning Invalid credentials. The API key is wrong. API access not allowed. The brand is not on the Enterprise plan, or the giveaway is not yours. This competition ID doesn&#8217;t belong to you. The competition_id is not one of your giveaways. RATE LIMIT! You are only allowed 1 API call per second. Slow down. &lt;parameter&gt; is not set. A required parameter is missing. Quick start examples cURL # GET &#8211; List all users for a giveaway curl &quot;https:\/\/sweepwidgetapi.com\/sw_api\/users?competition_id=123&amp;page_start=1&quot; \\ -H &quot;Authorization: Bearer YOUR_API_KEY&quot; # POST &#8211; Enter a user into a giveaway curl -X POST &quot;https:\/\/sweepwidgetapi.com\/sw_api\/new-entry&quot; \\ -H &quot;Authorization: Bearer YOUR_API_KEY&quot; \\ -H &quot;Content-Type: application\/json&quot; \\ -d &#39;{ &quot;competition_id&quot;: 123, &quot;user_name&quot;: &quot;Jane&quot;, &quot;user_email&quot;: &quot;jane@example.com&quot;, &quot;entry_amount&quot;: 1, &quot;giveaway_link&quot;: &quot;https:\/\/yoursite.com&quot; }&#39; Python import requests API_KEY = &quot;YOUR_API_KEY&quot; headers = {&quot;Authorization&quot;: f&quot;Bearer {API_KEY}&quot;} # GET &#8211; List all users for a giveaway response = requests.get( &quot;https:\/\/sweepwidgetapi.com\/sw_api\/users&quot;, params={&quot;competition_id&quot;: 123, &quot;page_start&quot;: 1}, headers=headers ) print(response.json()) # POST &#8211; Enter a user into a giveaway response = requests.post( &quot;https:\/\/sweepwidgetapi.com\/sw_api\/new-entry&quot;, json={ &quot;competition_id&quot;: 123, &quot;user_name&quot;: &quot;Jane&quot;, &quot;user_email&quot;: &quot;jane@example.com&quot;, &quot;entry_amount&quot;: 1, &quot;giveaway_link&quot;: &quot;https:\/\/yoursite.com&quot; }, headers=headers ) print(response.json()) JavaScript (Node.js) const API_KEY = &quot;YOUR_API_KEY&quot;; const headers = { &quot;Authorization&quot;: `Bearer ${API_KEY}`, &quot;Content-Type&quot;: &quot;application\/json&quot; }; \/\/ GET &#8211; List all users for a giveaway const usersRes = await fetch( &quot;https:\/\/sweepwidgetapi.com\/sw_api\/users?competition_id=123&amp;page_start=1&quot;, { headers } ); const users = await usersRes.json(); \/\/ POST &#8211; Enter a user into a giveaway const entryRes = await fetch( &quot;https:\/\/sweepwidgetapi.com\/sw_api\/new-entry&quot;, { method: &quot;POST&quot;, headers, body: JSON.stringify({ competition_id: 123, user_name: &quot;Jane&quot;, user_email: &quot;jane@example.com&quot;, entry_amount: 1, giveaway_link: &quot;https:\/\/yoursite.com&quot; }) } ); const result = await entryRes.json(); API Endpoints Read Endpoints GET List all users for a giveaway GET List all winners for a giveaway GET List all entries for a giveaway GET List all giveaways GET List all entries for a single user GET List all giveaways a user has entered GET Fetch referral link for a user Write Endpoints POST Update whitelisted emails POST Add new entry method POST Update an entry method POST Delete an entry method POST Create a giveaway POST Update a giveaway POST Delete a giveaway POST Add a prize to a giveaway POST Add an unlock reward to a giveaway POST Add manual entries for a user POST Enter user into a giveaway POST Submit an entry with a file upload List all users for a giveaway This method allows you to get each unique user that has entered a giveaway. GET https:\/\/sweepwidgetapi.com\/sw_api\/users Parameters Parameter Type Description Required api_key String API developer key. Can also be sent as Authorization: Bearer header. Required competition_id Integer ID of your competition. Required page_start Integer The page you want to start on. Page 1 returns the first 50 users. Pages 2 and later can return up to 100 rows that overlap the next page, so remove duplicates by user_id. Required Example Request $curl = curl_init(); $url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/users?page_start=1&amp;competition_id=123&quot;; curl_setopt_array($curl, array( CURLOPT_URL =&gt; $url, CURLOPT_RETURNTRANSFER =&gt; true, CURLOPT_ENCODING =&gt; &quot;&quot;, CURLOPT_MAXREDIRS =&gt; 10, CURLOPT_TIMEOUT =&gt; 30, CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST =&gt; &quot;GET&quot;, CURLOPT_HTTPHEADER =&gt; array( &quot;Authorization: Bearer YOUR_API_KEY&quot;, &quot;Content-Type: application\/json&quot; ), )); $response = json_decode(curl_exec($curl)); var_dump($response); Example Response { &quot;data&quot;: [ { &quot;user_id&quot;: 123, &quot;user_name&quot;: &quot;Test User&quot;, &quot;user_email&quot;: &quot;one@test.com&quot;, &quot;birthday&quot;: &quot;04-25-1994&quot;, &quot;custom_identifier&quot;: &quot;your-reference-id&quot;, &quot;entry_type&quot;: &quot;User Details&quot;, &quot;timestamp&quot;: &quot;2020-06-26 11:18:21&quot;, &quot;country&quot;: &quot;United States&quot; } ] } When there are no more rows, the response is a plain JSON string such as &#8220;No entries on page 50.&#8221; instead of a data object. List all winners for a giveaway This method allows you to fetch all of the winners for a giveaway. GET https:\/\/sweepwidgetapi.com\/sw_api\/winners Parameters Parameter Type Description Required api_key String API developer key. Can also be sent as Authorization: Bearer header. Required competition_id Integer ID of your competition. Required page_start Integer The page you want to start on. JSON output returns 50 rows at a time. Required Example Request $curl = curl_init(); $url = &quot;https:\/\/sweepwidgetapi.com\/sw_api\/winners?page_start=1&amp;competition_id=123&quot;; curl_setopt_array($curl, array( CURLOPT_URL =&gt; $url, CURLOPT_RETURNTRANSFER =&gt; true, CURLOPT_ENCODING =&gt; &quot;&quot;, CURLOPT_MAXREDIRS =&gt; 10, CURLOPT_TIMEOUT =&gt; 30, CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST =&gt; &quot;GET&quot;, CURLOPT_HTTPHEADER =&gt; array( &quot;Authorization: Bearer YOUR_API_KEY&quot;, &quot;Content-Type: application\/json&quot; ), )); $response = json_decode(curl_exec($curl)); var_dump($response); Example Response { &quot;data&quot;: [ { &quot;user_id&quot;: 123, &quot;user_name&quot;: &quot;Test User&quot;, &quot;user_email&quot;: &quot;one@test.com&quot;, &quot;birthday&quot;: &quot;04-25-1994&quot;, &quot;custom_identifier&quot;: &quot;your-reference-id&quot;, &quot;country&quot;: &quot;United States&quot;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[],"class_list":["post-1074","post","type-post","status-publish","format-standard","hentry","category-integrations"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SweepWidget API Documentation<\/title>\n<meta name=\"description\" content=\"The SweepWidget API allows you to read and write data to your giveaways. Learn the API endpoints, accepted parameters, and outputted data.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sweepwidget.com\/docs\/sweepwidget-api\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SweepWidget API Documentation\" \/>\n<meta property=\"og:description\" content=\"The SweepWidget API allows you to read and write data to your giveaways. Learn the API endpoints, accepted parameters, and outputted data.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sweepwidget.com\/docs\/sweepwidget-api\" \/>\n<meta property=\"og:site_name\" content=\"SweepWidget Help Docs\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-27T23:26:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-19T10:29:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1500\" \/>\n\t<meta property=\"og:image:height\" content=\"832\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"SweepWidget\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"SweepWidget\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api\"},\"author\":{\"name\":\"SweepWidget\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#\\\/schema\\\/person\\\/4cca2bc9c600116750eca1bfff6648e0\"},\"headline\":\"SweepWidget API Documentation\",\"datePublished\":\"2020-06-27T23:26:41+00:00\",\"dateModified\":\"2026-11-19T10:29:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api\"},\"wordCount\":5022,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/api-docs-1-1024x568.png\",\"articleSection\":[\"Integrations\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api\",\"url\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api\",\"name\":\"SweepWidget API Documentation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/api-docs-1-1024x568.png\",\"datePublished\":\"2020-06-27T23:26:41+00:00\",\"dateModified\":\"2026-11-19T10:29:51+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#\\\/schema\\\/person\\\/4cca2bc9c600116750eca1bfff6648e0\"},\"description\":\"The SweepWidget API allows you to read and write data to your giveaways. Learn the API endpoints, accepted parameters, and outputted data.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api#primaryimage\",\"url\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/api-docs-1.png\",\"contentUrl\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/api-docs-1.png\",\"width\":1500,\"height\":832},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/sweepwidget-api#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SweepWidget API Documentation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#website\",\"url\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/\",\"name\":\"SweepWidget Help Docs\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/#\\\/schema\\\/person\\\/4cca2bc9c600116750eca1bfff6648e0\",\"name\":\"SweepWidget\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91c2f57672b440838a4205ff021607b3d77efd9ac80a80984ce065da067e51e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91c2f57672b440838a4205ff021607b3d77efd9ac80a80984ce065da067e51e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91c2f57672b440838a4205ff021607b3d77efd9ac80a80984ce065da067e51e?s=96&d=mm&r=g\",\"caption\":\"SweepWidget\"},\"sameAs\":[\"https:\\\/\\\/sweepwidget.com\\\/docs\"],\"url\":\"https:\\\/\\\/sweepwidget.com\\\/docs\\\/author\\\/sweepwidget\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SweepWidget API Documentation","description":"The SweepWidget API allows you to read and write data to your giveaways. Learn the API endpoints, accepted parameters, and outputted data.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api","og_locale":"en_US","og_type":"article","og_title":"SweepWidget API Documentation","og_description":"The SweepWidget API allows you to read and write data to your giveaways. Learn the API endpoints, accepted parameters, and outputted data.","og_url":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api","og_site_name":"SweepWidget Help Docs","article_published_time":"2020-06-27T23:26:41+00:00","article_modified_time":"2026-11-19T10:29:51+00:00","og_image":[{"width":1500,"height":832,"url":"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1.png","type":"image\/png"}],"author":"SweepWidget","twitter_card":"summary_large_image","twitter_misc":{"Written by":"SweepWidget","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api#article","isPartOf":{"@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api"},"author":{"name":"SweepWidget","@id":"https:\/\/sweepwidget.com\/docs\/#\/schema\/person\/4cca2bc9c600116750eca1bfff6648e0"},"headline":"SweepWidget API Documentation","datePublished":"2020-06-27T23:26:41+00:00","dateModified":"2026-11-19T10:29:51+00:00","mainEntityOfPage":{"@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api"},"wordCount":5022,"commentCount":0,"image":{"@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api#primaryimage"},"thumbnailUrl":"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1-1024x568.png","articleSection":["Integrations"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api","url":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api","name":"SweepWidget API Documentation","isPartOf":{"@id":"https:\/\/sweepwidget.com\/docs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api#primaryimage"},"image":{"@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api#primaryimage"},"thumbnailUrl":"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1-1024x568.png","datePublished":"2020-06-27T23:26:41+00:00","dateModified":"2026-11-19T10:29:51+00:00","author":{"@id":"https:\/\/sweepwidget.com\/docs\/#\/schema\/person\/4cca2bc9c600116750eca1bfff6648e0"},"description":"The SweepWidget API allows you to read and write data to your giveaways. Learn the API endpoints, accepted parameters, and outputted data.","breadcrumb":{"@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sweepwidget.com\/docs\/sweepwidget-api"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api#primaryimage","url":"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1.png","contentUrl":"https:\/\/sweepwidget.com\/docs\/wp-content\/uploads\/2020\/06\/api-docs-1.png","width":1500,"height":832},{"@type":"BreadcrumbList","@id":"https:\/\/sweepwidget.com\/docs\/sweepwidget-api#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sweepwidget.com\/docs\/"},{"@type":"ListItem","position":2,"name":"SweepWidget API Documentation"}]},{"@type":"WebSite","@id":"https:\/\/sweepwidget.com\/docs\/#website","url":"https:\/\/sweepwidget.com\/docs\/","name":"SweepWidget Help Docs","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sweepwidget.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sweepwidget.com\/docs\/#\/schema\/person\/4cca2bc9c600116750eca1bfff6648e0","name":"SweepWidget","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d91c2f57672b440838a4205ff021607b3d77efd9ac80a80984ce065da067e51e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d91c2f57672b440838a4205ff021607b3d77efd9ac80a80984ce065da067e51e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d91c2f57672b440838a4205ff021607b3d77efd9ac80a80984ce065da067e51e?s=96&d=mm&r=g","caption":"SweepWidget"},"sameAs":["https:\/\/sweepwidget.com\/docs"],"url":"https:\/\/sweepwidget.com\/docs\/author\/sweepwidget"}]}},"_links":{"self":[{"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/posts\/1074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/comments?post=1074"}],"version-history":[{"count":90,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/posts\/1074\/revisions"}],"predecessor-version":[{"id":7843,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/posts\/1074\/revisions\/7843"}],"wp:attachment":[{"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/media?parent=1074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/categories?post=1074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sweepwidget.com\/docs\/wp-json\/wp\/v2\/tags?post=1074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}