Forum Discussion

rosdyana's avatar
2 years ago

Unable to create post using API

Hi,

Recently, I got this error when trying to create a post using the API

{
    "status": "error",
    "message": "This post contains content that is not permitted in the community. You must remove this content before publishing.",
    "data": {
        "type": "error_data",
        "code": 425,
        "developer_message": "",
        "more_info": ""
    },
    "metadata": {}
}

 I follow the API docs from here https://developer.khoros.com/khoroscommunitydevdocs/reference/create-a-message

Your help in this matter would be greatly appreciated.

  • I don't remember the error message I received but ran into a similar problem once editing posts with the API. That turned out to be because of the HTML included in the posts. I had to make sure the users editing posts had full HTML permission. (This was a tool I made for employees only so that was ok)

    Another possibility, are you adding attachments that aren't an allowed file type in your community?

    Anything that might cause an error when trying to post directly on the community will likely also cause an error when doing the same with the API.

2 Replies

  • I don't remember the error message I received but ran into a similar problem once editing posts with the API. That turned out to be because of the HTML included in the posts. I had to make sure the users editing posts had full HTML permission. (This was a tool I made for employees only so that was ok)

    Another possibility, are you adding attachments that aren't an allowed file type in your community?

    Anything that might cause an error when trying to post directly on the community will likely also cause an error when doing the same with the API.

  • rosdyana's avatar
    rosdyana
    Ace
    2 years ago

    The attachment settings address this problem, but the behavior is a bit peculiar.

    Firstly, when using a custom extension, it doesn't function as expected.

    Secondly, by removing the custom extension, the problem is resolved.

    Thirdly, reintroducing the custom extension brings back proper functionality.

    Quite amusing, actually!

    Thank you so much Andrew!