MENU navbar-image

Introduction

You can use our ProductLift's API to smoothly integrate ProductLift with other services.

This documentation aims to provide all the information you need to work with our API.

Base URL

{YOUR-PORTAL-URL}

Authenticating requests

Authenticate requests to this API's endpoints by sending an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your portal and go to Customize > API & Webhooks.

Categories

Categories (e.g. Bug, Integration) can be used to organize and group posts. Categories are visible for your users. Posts can have multiple categories.

List categories

requires authentication

Lists all categories of your portal.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/categories" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/categories"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/categories',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/categories'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": [
        {
            "id": 1,
            "name": "Bug",
            "color": "#ABDEE6"
        },
        {
            "id": 1,
            "name": "Bug",
            "color": "#ABDEE6"
        }
    ]
}
 

Request   

GET api/v1/categories

Create category

requires authentication

Creates a new category in your portal.

Example request:
curl --request POST \
    "{YOUR-PORTAL-URL}/api/v1/categories" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/categories"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    '{YOUR-PORTAL-URL}/api/v1/categories',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/categories'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "id": 1,
        "name": "Bug",
        "color": "#ABDEE6"
    }
}
 

Example response (422):


{
 "message": "The given data was invalid.",
 "errors": {
 "name": [
     "The name has already been taken."
 ]
}
 

Request   

POST api/v1/categories

Body Parameters

name  string optional  

Delete category

requires authentication

Deletes a specified category.

Example request:
curl --request DELETE \
    "{YOUR-PORTAL-URL}/api/v1/categories/13" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/categories/13"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    '{YOUR-PORTAL-URL}/api/v1/categories/13',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/categories/13'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):


{}
 

Example response (404):


{
    "message": "No query results for model [App\\Category] ..."
}
 

Request   

DELETE api/v1/categories/{id}

URL Parameters

id  integer  

The ID of the category.

Update category

requires authentication

Updates the details of a category.

Example request:
curl --request PATCH \
    "{YOUR-PORTAL-URL}/api/v1/categories/10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"color\": \"#0EZVor$\\/m\"
}"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/categories/10"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "color": "#0EZVor$\/m"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->patch(
    '{YOUR-PORTAL-URL}/api/v1/categories/10',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'color' => '#0EZVor$/m',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/categories/10'
payload = {
    "color": "#0EZVor$\/m"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PATCH', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "data": {
        "id": 1,
        "name": "Bug",
        "color": "#ABDEE6"
    }
}
 

Example response (404):


{
    "message": "No query results for model [App\\Category] ..."
}
 

Example response (422):


{
 "message": "The given data was invalid.",
 "errors": {
 "name": [
     "The name has already been taken."
 ]
}
 

Request   

PATCH api/v1/categories/{id}

URL Parameters

id  integer  

The ID of the category.

Body Parameters

name  string optional  

color  string  

Hex color code for the category. The value format is invalid.

Portal

You should see a portal as a single project for your product or service. It can consist of roadmaps, changelogs, voting boards, etc.

Retrieve portal

requires authentication

Retrieves the details of your portal.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/portal" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/portal"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/portal',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/portal'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "guid": "439a0970-4699-49db-aa9e-bfcdf779adeb",
        "title": "dolor hic",
        "localization": "en"
    }
}
 

Request   

GET api/v1/portal

Posts

Manage posts.

Find duplicates

requires authentication

Searches the database for duplicate posts.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/posts/search_duplicates" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"nprxdclocmoialmuloomvmtrhgxgh\",
    \"description\": \"s\"
}"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/posts/search_duplicates"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "title": "nprxdclocmoialmuloomvmtrhgxgh",
    "description": "s"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/posts/search_duplicates',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'title' => 'nprxdclocmoialmuloomvmtrhgxgh',
            'description' => 's',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/posts/search_duplicates'
payload = {
    "title": "nprxdclocmoialmuloomvmtrhgxgh",
    "description": "s"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, json=payload)
response.json()

Example response (200):


{
 "count": 0,
}
 

Example response (200):


{
 "count": 1,
 "posts": {
             {
                 "id": "d8QEXH",
                 "title": "Open links in new window",
                 "description": "Option to open links in a new window."
              }
          }
}
 

Request   

GET api/v1/posts/search_duplicates

Body Parameters

title  string optional  

Optionally adjust the post title. Must be at least 6 characters. Must not be greater than 80 characters.

description  string optional  

Optionally adjust the description of the post. Must be at least 3 characters.

List posts

requires authentication

Lists all posts of your portal.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/posts" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/posts"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/posts',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/posts'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": [
        {
            "id": "VBa3HO",
            "title": "Webhook customer data",
            "description": "It would be fantastic if, using webhooks, I could get more data."
        },
        {
            "id": "uJWCp4",
            "title": "Select icon",
            "description": "What about having available other icons instead of the default one? Just to have more choices."
        }
    ]
}
 

Request   

GET api/v1/posts

Create post

requires authentication

Creates a new post in your portal.

Example request:
curl --request POST \
    "{YOUR-PORTAL-URL}/api/v1/posts" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"cwgosxnfyxewqqwgfqlrmnlllkestrpvtlrurzbyhywgqojwnhjlvthqi\",
    \"description\": \"xb\",
    \"category_id\": 18,
    \"status_id\": 20,
    \"user_id\": \"81ce4244-ccd8-3ec5-a45c-8e07566f2a3a\"
}"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/posts"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "title": "cwgosxnfyxewqqwgfqlrmnlllkestrpvtlrurzbyhywgqojwnhjlvthqi",
    "description": "xb",
    "category_id": 18,
    "status_id": 20,
    "user_id": "81ce4244-ccd8-3ec5-a45c-8e07566f2a3a"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    '{YOUR-PORTAL-URL}/api/v1/posts',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'title' => 'cwgosxnfyxewqqwgfqlrmnlllkestrpvtlrurzbyhywgqojwnhjlvthqi',
            'description' => 'xb',
            'category_id' => 18,
            'status_id' => 20,
            'user_id' => '81ce4244-ccd8-3ec5-a45c-8e07566f2a3a',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/posts'
payload = {
    "title": "cwgosxnfyxewqqwgfqlrmnlllkestrpvtlrurzbyhywgqojwnhjlvthqi",
    "description": "xb",
    "category_id": 18,
    "status_id": 20,
    "user_id": "81ce4244-ccd8-3ec5-a45c-8e07566f2a3a"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (404):


{
    "message": "No query results for model [App\\User] ..."
}
 

Example response (422):


{
 "message": "The given data was invalid.",
 "errors": {
   "user_id": [
     "The user id must be a valid UUID."
   ]
}
 

Example response (200):


{
    "data": {
        "id": "WEukJy",
        "title": "Photo upload",
        "description": "It would be great if I can upload a photo.",
        "author": {
            "id": "420b8cfb-2c3d-4df2-b6bd-7ac6aae1a14a",
            "name": "Madalyn",
            "email": "robyn.oconner@example.net",
            "role": "member",
            "counter_votes": 4,
            "counter_comments": 0,
            "counter_posts": 0,
            "counter_comment_votes": 0
        },
        "categories": [
            {
                "id": 3,
                "name": "Integration",
                "color": "#FFAEA5"
            }
        ],
        "status": {
            "id": 3,
            "name": "💪 Now available",
            "color": "#FFCCB6",
            "tab_name": "Updates"
        }
    }
}
 

Request   

POST api/v1/posts

Body Parameters

title  string  

Post title. Must be at least 6 characters. Must not be greater than 80 characters.

description  string  

Description of the post. Must be at least 3 characters.

category_id  integer optional  

Optional category ID of the post. If not given or not found, no category will be added.

status_id  integer optional  

Optional status ID of the post. If not given or not found, the default status will be selected.

user_id  string optional  

Optional user ID. If not given or not found, the post will be anonymous. Must be a valid UUID.

Retrieve post

requires authentication

Retrieves the details of a specified post.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (404):


{
    "message": "No query results for model [App\\Post] ..."
}
 

Example response (200):


{
    "data": {
        "id": "WEukJy",
        "title": "Photo upload",
        "description": "It would be great if I can upload a photo.",
        "author": {
            "id": "420b8cfb-2c3d-4df2-b6bd-7ac6aae1a14a",
            "name": "Madalyn",
            "email": "robyn.oconner@example.net",
            "role": "member",
            "counter_votes": 4,
            "counter_comments": 0,
            "counter_posts": 0,
            "counter_comment_votes": 0
        },
        "categories": [
            {
                "id": 3,
                "name": "Integration",
                "color": "#FFAEA5"
            }
        ],
        "status": {
            "id": 3,
            "name": "💪 Now available",
            "color": "#FFCCB6",
            "tab_name": "Updates"
        }
    }
}
 

Request   

GET api/v1/posts/{id}

URL Parameters

id  string  

The ID of the post.

Update post

requires authentication

Updates the specified post by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Example request:
curl --request PUT \
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"djazwaf\",
    \"description\": \"ue\",
    \"user_id\": \"41355ef2-1810-385e-9838-dc0461e7f842\"
}"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "title": "djazwaf",
    "description": "ue",
    "user_id": "41355ef2-1810-385e-9838-dc0461e7f842"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'title' => 'djazwaf',
            'description' => 'ue',
            'user_id' => '41355ef2-1810-385e-9838-dc0461e7f842',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh'
payload = {
    "title": "djazwaf",
    "description": "ue",
    "user_id": "41355ef2-1810-385e-9838-dc0461e7f842"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (404):


{
    "message": "No query results for model [App\\Post] ..."
}
 

Example response (404):


{
    "message": "No query results for model [App\\User] ..."
}
 

Example response (422):


{
 "message": "The given data was invalid.",
 "errors": {
   "user_id": [
     "The user id must be a valid UUID."
   ]
}
 

Example response (200):


{
    "data": {
        "id": "WEukJy",
        "title": "Photo upload",
        "description": "It would be great if I can upload a photo.",
        "author": {
            "id": "420b8cfb-2c3d-4df2-b6bd-7ac6aae1a14a",
            "name": "Madalyn",
            "email": "robyn.oconner@example.net",
            "role": "member",
            "counter_votes": 4,
            "counter_comments": 0,
            "counter_posts": 0,
            "counter_comment_votes": 0
        },
        "categories": [
            {
                "id": 3,
                "name": "Integration",
                "color": "#FFAEA5"
            }
        ],
        "status": {
            "id": 3,
            "name": "💪 Now available",
            "color": "#FFCCB6",
            "tab_name": "Updates"
        }
    }
}
 

Request   

PUT api/v1/posts/{id}

PATCH api/v1/posts/{id}

URL Parameters

id  string  

The ID of the post.

Body Parameters

title  string optional  

Optionally adjust the post title. Must be at least 6 characters. Must not be greater than 80 characters.

description  string optional  

Optionally adjust the description of the post. Must be at least 3 characters.

user_id  string optional  

Optionally adjust user ID. If NULL is given, the post will become anonymous. Must be a valid UUID.

Delete post

requires authentication

Deletes a specified post.

Example request:
curl --request DELETE \
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):


{}
 

Example response (404):


{
    "message": "No query results for model [App\\Post] ..."
}
 

Request   

DELETE api/v1/posts/{id}

URL Parameters

id  string  

The ID of the post.

Statuses

Posts are connected to a status (e.g. Planned, Done). ProductLift allows you to create any status.

List statuses

requires authentication

Lists all statuses in your portal.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/statuses" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/statuses"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/statuses',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/statuses'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": [
        {
            "id": 1,
            "name": "👍 Gathering votes",
            "color": "#DCD9F8",
            "tab_name": "Wish list"
        },
        {
            "id": 1,
            "name": "👍 Gathering votes",
            "color": "#DCD9F8",
            "tab_name": "Wish list"
        }
    ]
}
 

Request   

GET api/v1/statuses

Users

Users can create posts, votes, and comments. You can create and manage users from the API.

Find by email

requires authentication

Retrieves the details of a specified user by email.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/users/find_by_email" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"bfzvbkhgxnhaszqevlfaubpcvqfdoariervvsaxcehqldmfhkfnkmrwomwehekgszu\"
}"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/users/find_by_email"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "bfzvbkhgxnhaszqevlfaubpcvqfdoariervvsaxcehqldmfhkfnkmrwomwehekgszu"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/users/find_by_email',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'bfzvbkhgxnhaszqevlfaubpcvqfdoariervvsaxcehqldmfhkfnkmrwomwehekgszu',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/users/find_by_email'
payload = {
    "email": "bfzvbkhgxnhaszqevlfaubpcvqfdoariervvsaxcehqldmfhkfnkmrwomwehekgszu"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "data": {
        "id": "d54c077f-a5cc-4b0a-8ea7-c177d2b6dced",
        "name": "Oda",
        "email": "zbeier@example.net",
        "role": "member",
        "counter_votes": 0,
        "counter_comments": 0,
        "counter_posts": 0,
        "counter_comment_votes": 0
    }
}
 

Example response (404):


{
    "message": "User not found"
}
 

Example response (422):


{
 "message": "The given data was invalid.",
 "errors": {
 "role": [
     "The email must be a valid email address."
 ]
}
 

Request   

GET api/v1/users/find_by_email

Body Parameters

email  string  

The user's email. Must be a valid email address. Must not be greater than 191 characters.

List users

requires authentication

Lists all users of your portal.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/users" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/users"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/users',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/users'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": [
        {
            "id": "cdbb0e83-b57a-4fd9-ac6d-d1e4e3e9acde",
            "name": "Justina",
            "email": "ike41@example.org",
            "role": "member",
            "counter_votes": 0,
            "counter_comments": 0,
            "counter_posts": 0,
            "counter_comment_votes": 0
        },
        {
            "id": "877439e0-adf2-465a-873c-77d03d0008ae",
            "name": "Isaiah",
            "email": "concepcion.kulas@example.net",
            "role": "member",
            "counter_votes": 0,
            "counter_comments": 0,
            "counter_posts": 0,
            "counter_comment_votes": 0
        }
    ]
}
 

Request   

GET api/v1/users

Create user

requires authentication

Creates a new user in your portal. You can either provide a password, or you can invite the user.

Example request:
curl --request POST \
    "{YOUR-PORTAL-URL}/api/v1/users" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"wrgkwxtcxfgfdksuvcsznadpfngpdylqhmubkmuosleyzdderwflqphplergfedknqplggyaltoufqvvwssaptyzvxmgnfgnfzyjadzavvvbtqkkmhloicgn\",
    \"role\": \"member\",
    \"name\": \"rwucalmyrygbuvjslbjkvasxjtbmejjjbwhltldicwpujwysokejijdslissyxoqi\",
    \"invitation_message\": \"zbykzxrsmqogqkjxwvjycencbziysmctpfjeqdwhmqpyalturllusgwhtdiahmykjktstbbgabqvoknruybvuodirnkvmmhxxluczvqpbqccdlnamhxdayagtqdcuqibicwibpfcpqavktbmijbgjhqw\",
    \"password\": \"xi\"
}"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/users"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "wrgkwxtcxfgfdksuvcsznadpfngpdylqhmubkmuosleyzdderwflqphplergfedknqplggyaltoufqvvwssaptyzvxmgnfgnfzyjadzavvvbtqkkmhloicgn",
    "role": "member",
    "name": "rwucalmyrygbuvjslbjkvasxjtbmejjjbwhltldicwpujwysokejijdslissyxoqi",
    "invitation_message": "zbykzxrsmqogqkjxwvjycencbziysmctpfjeqdwhmqpyalturllusgwhtdiahmykjktstbbgabqvoknruybvuodirnkvmmhxxluczvqpbqccdlnamhxdayagtqdcuqibicwibpfcpqavktbmijbgjhqw",
    "password": "xi"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    '{YOUR-PORTAL-URL}/api/v1/users',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'wrgkwxtcxfgfdksuvcsznadpfngpdylqhmubkmuosleyzdderwflqphplergfedknqplggyaltoufqvvwssaptyzvxmgnfgnfzyjadzavvvbtqkkmhloicgn',
            'role' => 'member',
            'name' => 'rwucalmyrygbuvjslbjkvasxjtbmejjjbwhltldicwpujwysokejijdslissyxoqi',
            'invitation_message' => 'zbykzxrsmqogqkjxwvjycencbziysmctpfjeqdwhmqpyalturllusgwhtdiahmykjktstbbgabqvoknruybvuodirnkvmmhxxluczvqpbqccdlnamhxdayagtqdcuqibicwibpfcpqavktbmijbgjhqw',
            'password' => 'xi',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/users'
payload = {
    "email": "wrgkwxtcxfgfdksuvcsznadpfngpdylqhmubkmuosleyzdderwflqphplergfedknqplggyaltoufqvvwssaptyzvxmgnfgnfzyjadzavvvbtqkkmhloicgn",
    "role": "member",
    "name": "rwucalmyrygbuvjslbjkvasxjtbmejjjbwhltldicwpujwysokejijdslissyxoqi",
    "invitation_message": "zbykzxrsmqogqkjxwvjycencbziysmctpfjeqdwhmqpyalturllusgwhtdiahmykjktstbbgabqvoknruybvuodirnkvmmhxxluczvqpbqccdlnamhxdayagtqdcuqibicwibpfcpqavktbmijbgjhqw",
    "password": "xi"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "data": {
        "id": "2b510a93-3eab-4a4b-9767-16b1772d71a9",
        "name": "Carolina",
        "email": "spurdy@example.com",
        "role": "member",
        "counter_votes": 0,
        "counter_comments": 0,
        "counter_posts": 0,
        "counter_comment_votes": 0
    }
}
 

Example response (422):


{
    "message": "User already exists"
}
 

Example response (422):


{
 "message": "The given data was invalid.",
 "errors": {
 "role": [
     "The selected role is invalid."
 ]
}
 

Request   

POST api/v1/users

Body Parameters

email  string optional  

Must be a valid email address. Must not be greater than 191 characters.

role  string  

Must be one of admin or member.

name  string optional  

Name for the user. Omit or null to automatically determine a name based on the email. Must not be greater than 100 characters.

invitation_message  string optional  

You can provide a custom invitation message. Omit or null to use the default message. Must not be greater than 1000 characters.

skip_email  string optional  

Provide a value to skip sending an email. Omit or null to send invitation email.

password  string optional  

Provide a password to skip sending an invitation. Omit or null to use an invitation (for which an email can be sent or not). Must not be greater than 100 characters. Must be at least 8 characters.

Retrieve user

requires authentication

Retrieves the details of a specified user.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "id": "18218543-b50b-4a6b-aab2-2123ba2f1ed2",
        "name": "Alphonso",
        "email": "winfield65@example.com",
        "role": "member",
        "counter_votes": 0,
        "counter_comments": 0,
        "counter_posts": 0,
        "counter_comment_votes": 0
    }
}
 

Example response (404):


{
    "message": "No query results for model [App\\User] ..."
}
 

Request   

GET api/v1/users/{id}

URL Parameters

id  string  

The ID of the user.

Update user

requires authentication

Updates the details of a specified user.

Example request:
curl --request PUT \
    "{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"hickle.claudia@example.com\",
    \"role\": \"member\",
    \"name\": \"rdyxoqrgrcotthewiovviipnuijdcfpkdslndmmvrxztdacipfu\",
    \"password\": \"awat\"
}"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "hickle.claudia@example.com",
    "role": "member",
    "name": "rdyxoqrgrcotthewiovviipnuijdcfpkdslndmmvrxztdacipfu",
    "password": "awat"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
    '{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'hickle.claudia@example.com',
            'role' => 'member',
            'name' => 'rdyxoqrgrcotthewiovviipnuijdcfpkdslndmmvrxztdacipfu',
            'password' => 'awat',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88'
payload = {
    "email": "hickle.claudia@example.com",
    "role": "member",
    "name": "rdyxoqrgrcotthewiovviipnuijdcfpkdslndmmvrxztdacipfu",
    "password": "awat"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "data": {
        "id": "e5bf65e7-8419-42ba-ad8c-358f9cd3e202",
        "name": "Susana",
        "email": "loyce.daugherty@example.org",
        "role": "member",
        "counter_votes": 0,
        "counter_comments": 0,
        "counter_posts": 0,
        "counter_comment_votes": 0
    }
}
 

Example response (404):


{
    "message": "No query results for model [App\\User] ..."
}
 

Example response (422):


{
 "message": "The given data was invalid.",
 "errors": {
 "role": [
     "The selected role is invalid."
 ]
}
 

Request   

PUT api/v1/users/{id}

PATCH api/v1/users/{id}

URL Parameters

id  string  

The ID of the user.

Body Parameters

email  string optional  

Make null or omit to keep current value. Must be unique in the portal. Must be a valid email address.

role  string optional  

Make null or omit to keep current value. Must be one of admin or member.

name  string optional  

Make null or omit to keep current value. Must not be greater than 100 characters.

password  string optional  

Make null or omit to keep current value. Must not be greater than 100 characters. Must be at least 8 characters.

Delete user

requires authentication

Deletes a specified user.

Example request:
curl --request DELETE \
    "{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"delete_all_data\": true
}"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "delete_all_data": true
};

fetch(url, {
    method: "DELETE",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    '{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'delete_all_data' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/users/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88'
payload = {
    "delete_all_data": true
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers, json=payload)
response.json()

Example response (200):


{}
 

Example response (404):


{
    "message": "No query results for model [App\\User] ..."
}
 

Request   

DELETE api/v1/users/{id}

URL Parameters

id  string  

The ID of the user.

Body Parameters

delete_all_data  boolean optional  

Set true or 1 to delete all data from this user. Otherwise, posts, comments, will remain with [User Deleted] as the username.

Votes

Manage votes on your posts.

List votes

requires authentication

Lists all votes of a post.

Example request:
curl --request GET \
    --get "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": [
        {
            "created_at": "2020-06-09T14:40:38.000000Z",
            "voter": {
                "id": "2850e389-2827-4316-a50a-fcdcc6474b5d",
                "name": "Jordi",
                "email": "descubre@exploradoresdemartech.com",
                "role": "member",
                "counter_votes": 3,
                "counter_comments": 0,
                "counter_posts": 0,
                "counter_comment_votes": 0
            }
        },
        {
            "created_at": "2020-06-09T14:40:38.000000Z",
            "voter": {
                "id": "2850e389-2827-4316-a50a-fcdcc6474b5d",
                "name": "Jordi",
                "email": "descubre@exploradoresdemartech.com",
                "role": "member",
                "counter_votes": 3,
                "counter_comments": 0,
                "counter_posts": 0,
                "counter_comment_votes": 0
            }
        }
    ]
}
 

Request   

GET api/v1/posts/{key}/votes

URL Parameters

key  string  

The ID of the post.

Revoke vote

requires authentication

Revoke users vote for a post.

Example request:
curl --request DELETE \
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()

Example response (200):


{}
 

Example response (404):


{
    "message": "No query results for model [App\\User] ..."
}
 

Example response (404):


{
    "message": "No query results for model [App\\Post] ..."
}
 

Example response (422):


{
    "message": "Post is not voteable."
}
 

Example response (422):


{
    "message": "User has not voted yet."
}
 

Request   

DELETE api/v1/posts/{key}/votes/{user}

URL Parameters

key  string  

The ID of the post.

user  string  

The ID of the user.

Create vote

requires authentication

Add the vote of a user to a post.

Example request:
curl --request POST \
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = '{YOUR-PORTAL-URL}/api/v1/posts/0UFQQh/votes/8cbfbfd6-ecc3-4ec3-8b31-ea76b11c1f88'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "created_at": "2020-06-09T14:40:38.000000Z",
        "voter": {
            "id": "2850e389-2827-4316-a50a-fcdcc6474b5d",
            "name": "Jordi",
            "email": "descubre@exploradoresdemartech.com",
            "role": "member",
            "counter_votes": 3,
            "counter_comments": 0,
            "counter_posts": 0,
            "counter_comment_votes": 0
        }
    }
}
 

Example response (404):


{
    "message": "No query results for model [App\\User] ..."
}
 

Example response (404):


{
    "message": "No query results for model [App\\Post] ..."
}
 

Example response (422):


{
    "message": "Post is not voteable."
}
 

Example response (422):


{
    "message": "User has not voted yet."
}
 

Request   

POST api/v1/posts/{key}/votes/{user}

URL Parameters

key  string  

The ID of the post.

user  string  

The ID of the user.