Skip to content

Posts¤

Post list¤

from lumapps.api.base_client import BaseClient
client = BaseClient(token="<your_token>")

body = {
    "contentId": community_id,
    "lang": "",
    }

posts = client.get_call(
    "community/post/search", body=body
)

For more details see the api documentation

Post get¤

from lumapps.api.base_client import BaseClient
client = BaseClient(token="<your_token>")

post = client.get_call(
    "community/post/get", uid="YOUR_POST_ID"
)

For more details see the api documentation

Post save¤

The variable post is a json object described here. You can either construct a new one from scratch:

post = {
    "customer": "YOUR_CUSTOMER_ID",
    "instance": "YOUR_INSTANCE_ID",
    "type": "post",
    "postType": "[DEFAULT|IDEA|QUESTION]",
    "externalKey": "YOUR_COMMUNITY_ID",
    "title": {"fr": "Some post title"},
    "content": {"fr": "Post content, you can use markdown"},
    "publicationDate": publication_date,
    "createdAt": publication_date,
    "startDate": publication_date,
    "version": 1,
}

or update properties from one you just got using the api.

from lumapps.api.base_client import BaseClient
client = BaseClient(token="<your_token>")

post = client.get_call(
    "community/post/get", uid="YOUR_POST_ID"
)

# Modify the post
post["tttle"] = {"fr": "New title"}

# Save the post
post = api.get_call(
    "community/post/save", body=post
)

For more details see the api documentation