humhub / rest

HumHub Rest API Module
24 stars 24 forks source link

# Unable to post with topics #85

Closed meowent closed 2 years ago

meowent commented 2 years ago

since this issue haven't be modify yet, we still use formdata to post message with humhub API https://githubhot.com/repo/humhub/humhub-modules-rest/issues/3

But while we want to add posting data with Topic that already been set, we find that the API format is not synchronize for example we gat posting data with : (1)"topics":[{"id":1,"name":"A1"},{"id":2,"name":"A2"},] for multiple topics on each post

but what the API document written is : (2)"topics": {"topic": {"id": 135,"name": "News"} (https://www.humhub.com/en/marketplace/rest/docs/html/post.html#/paths/~1post~1{id}/get)

What we need is to post message with some topics We have tried posting with the format which document is given with one topic (the second one) And also tried the format that humhub API actually responds (the first one) either of them were unsuccessful.

Can you give us the format and the way to post message with topic ?

yurabakhtin commented 2 years ago

@meowent The doc was wrong, thank you for the reporting. We fixed the code in order to support updating topics as it was described in doc, it will be in next release and will work as new doc:

create-post

@luke- Please review and merge PR https://github.com/humhub/rest/pull/86.

luke- commented 2 years ago

@yurabakhtin Thanks, please see me PR comment.

yurabakhtin commented 2 years ago

@luke- Please find my answers and new changes in the PR.

meowent commented 2 years ago

@yurabakhtin 👍 So on next release we can post with topics by using post update, but currently we are unable to posts with topics? Is there any other way for putting the topic on the post right now :D

yurabakhtin commented 2 years ago

@meowent Sorry, unfortunately current version has no possibility to update topics of a post. Current version can only work with topics https://www.humhub.com/en/marketplace/rest/docs/html/topic.html#tag/Topic , but there is no code in order to link a topic with a post.

theapk commented 2 years ago

@yurabakhtin What is the expected release date for this feature? :)

luke- commented 2 years ago

We just released 0.5.0 which adds the feature.