User Post Collectionse (0.8.23)

Download OpenAPI specification:Download

Make sure that in all requests you set the X-WP-Nonce header.

For collections the pagination is in the response header:
X-WP-Page
X-WP-Total
X-WP-TotalPages

Product related parts will only be available on a woocommerce install.

You can find out more about UPC at https:e//github.com/tauri77/user-post-collections.

lists

User posts list collection

Find Lists by status, author, etc.

Multiple filters values can be provided

query Parameters
context
string

Scope under which the request is made; determines fields present in response.

page
integer

Current page of the collection.

per_page
integer

Maximum number of items to be returned in result set.

search
string

Limit results to those matching a string.

after
string <date-time>

Limit response to lists created after a given ISO8601 compliant date.

modified_after
string <date-time>

Limit response to lists modified after a given ISO8601 compliant date.

before
string <date-time>

Limit response to lists created before a given ISO8601 compliant date.

modified_before
string <date-time>

Limit response to lists modified before a given ISO8601 compliant date.

author
Array of integers

Limit result set to lists assigned to specific authors.

include
Array of integers

Limit result set to lists with specific IDs.

offset
integer

Offset the result set by a specific number of items.

order
string
Enum: "asc" "desc"

Order sort attribute ascending or descending.

orderby
string
Enum: "author" "date" "id" "modified" "slug" "title"

Sort collection by attribute.

slug
Array of strings

Limit result set to lists with one or more specific slugs.

status
Array of strings
Items Enum: "publish" "private" "any"

Limit result set to lists assigned one or more statuses.

types
Array of strings
Items Enum: "simple" "numbered" "vote" "favorites" "bookmarks" "cart" "any"

Limit result set to lists assigned one or more types.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get the user lists

Return the user list (without items).

query Parameters
page
integer

Current page of the collection.

per_page
integer

Maximum number of items to be returned in result set.

adding
integer

Show only list that can add this post.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

list

A user posts list

Add a new list

query Parameters
author
integer

Author to set (requires user permissions).

title
required
string

List title.

content
string

List text description.

type
required
string
Enum: "simple" "numbered" "vote" "favorites" "bookmarks" "cart"

List type.

adding
integer

Create list, and add a post (postID).

status
required
string
Enum: "publish" "private"

List status.

Responses

Response samples

Content type
application/json
{
  • "id": 231,
  • "title": "My List",
  • "content": "This is my list description",
  • "author": 31,
  • "type": "simple",
  • "status": "private",
  • "count": 23,
  • "created": "2022-07-14T05:30:47+0000",
  • "modified": "2002-10-10T07:00:00Z",
  • "slug": "my-list-by-username",
  • "user_login": "UserName",
  • "user_link": "",
  • "vote_counter": 22,
  • "items_page": {
    },
  • "items": [
    ]
}

Find list by ID

Returns a single list

path Parameters
listId
required
integer <int64>

List ID requested

query Parameters
context
string

Scope under which the request is made; determines fields present in response.

Responses

Response samples

Content type
application/json
{
  • "id": 231,
  • "title": "My List",
  • "content": "This is my list description",
  • "author": 31,
  • "type": "simple",
  • "status": "private",
  • "count": 23,
  • "created": "2022-07-14T05:30:47+0000",
  • "modified": "2002-10-10T07:00:00Z",
  • "slug": "my-list-by-username",
  • "user_login": "UserName",
  • "user_link": "",
  • "vote_counter": 22,
  • "items_page": {
    },
  • "items": [
    ]
}

Updates a list.

Response with edited list (without items).

path Parameters
listId
required
integer <int64>

ID of list that needs to be updated

query Parameters
author
integer

Author to set.

title
string

List title.

content
string

List text description.

status
string
Enum: "publish" "private"

List status.

Responses

Response samples

Content type
application/json
{
  • "id": 231,
  • "title": "My List",
  • "content": "This is my list description",
  • "author": 31,
  • "type": "simple",
  • "status": "private",
  • "count": 23,
  • "created": "2022-07-14T05:30:47+0000",
  • "modified": "2002-10-10T07:00:00Z",
  • "slug": "my-list-by-username",
  • "user_login": "UserName",
  • "user_link": "",
  • "vote_counter": 22,
  • "items_page": {
    },
  • "items": [
    ]
}

Delete a list

Return deleted list as 'previous' property (without items).

path Parameters
listId
required
integer <int64>

List ID to delete

Responses

Response samples

Content type
application/json
{
  • "deleted": true,
  • "previus": {
    }
}

Get user Bookmarks

Returns a single list (The user bookmark).

query Parameters
context
string

Scope under which the request is made; determines fields present in response.

Responses

Response samples

Content type
application/json
{
  • "id": 231,
  • "title": "My List",
  • "content": "This is my list description",
  • "author": 31,
  • "type": "simple",
  • "status": "private",
  • "count": 23,
  • "created": "2022-07-14T05:30:47+0000",
  • "modified": "2002-10-10T07:00:00Z",
  • "slug": "my-list-by-username",
  • "user_login": "UserName",
  • "user_link": "",
  • "vote_counter": 22,
  • "items_page": {
    },
  • "items": [
    ]
}

Get user Favorites

Returns a single list (The user favorites).

query Parameters
context
string

Scope under which the request is made; determines fields present in response.

Responses

Response samples

Content type
application/json
{
  • "id": 231,
  • "title": "My List",
  • "content": "This is my list description",
  • "author": 31,
  • "type": "simple",
  • "status": "private",
  • "count": 23,
  • "created": "2022-07-14T05:30:47+0000",
  • "modified": "2002-10-10T07:00:00Z",
  • "slug": "my-list-by-username",
  • "user_login": "UserName",
  • "user_link": "",
  • "vote_counter": 22,
  • "items_page": {
    },
  • "items": [
    ]
}

itemList

An item on a list

Get items list

Usually for page > 1, the get for list return first page as property 'items'.

path Parameters
listId
required
integer <int64>

ID of list to return

query Parameters
page
integer

Current page of the collection.

per_page
integer

Maximum number of items to be returned in result set.

order
string
Enum: "asc" "desc"

Order sort attribute ascending or descending.

orderby
string
Enum: "" "votes" "position" "post_id" "added"

Sort collection by attribute.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create an item

path Parameters
listId
required
integer <int64>

ID of list that needs to be updated

query Parameters
post_id
required
integer

The post id for add to the list.

description
string

The item comment.

quantity
integer

The quantity for the post on the list.

context
string

Scope under which the request is made; determines fields present in response.

Responses

Response samples

Content type
application/json
{
  • "added": true,
  • "data": {
    },
  • "post": {},
  • "list": {
    }
}

Delete items list

path Parameters
listId
required
integer <int64>

The list ID

postId
required
integer <int64>

The post ID

Responses

Response samples

Content type
application/json
{
  • "deleted": true
}

Update an item list

If you change the position the other items in the list will also be updated. The new version of the item is returned as the -item- property.

path Parameters
listId
required
integer <int64>

The list ID

postId
required
integer <int64>

The post ID

query Parameters
position
integer

The position for the post on the list.

description
string

The description/comment for the post on the list.

quantity
integer

The quantity for the post on the list.

Responses

Response samples

Content type
application/json
{
  • "updated": true,
  • "item": {
    }
}

Vote to an item list

It is required that the list has support for votes

path Parameters
listId
required
integer <int64>

The list ID

postId
required
integer <int64>

The post ID

query Parameters
context
string
Example: context=web

Scope under which the request is made; determines fields present in response.

posts
string
Example: posts=55,58,56

Posts present in response, comma separated.

Responses

Response samples

Content type
application/json
{
  • "vote": true,
  • "vote_counter": 3,
  • "posts": [
    ]
}

misc

Other actions

Add all items to cart (woocommerce)

query Parameters
list
required
integer

The list id for add to cart.

Responses

Response samples

Content type
application/json
{
  • "cart_hash": "64efa61dcfee4aaf4a4be2c4471487e0",
  • "msg": "10 x “Sunglasses”, “Hoodie with Zipper”, “Vneck Tshirt” y “Hoodie” added.",
  • "err": "Product \"Beanie\" with quantity equal to zero was not added.\nProduct \"Belt\" with quantity equal to zero was not added.",
  • "fragments": {
    }
}