Upload API

Moved Technical Support

Suggested Topics


  • 0 Votes
    1 Posts
    170 Views

    I build my website base on nodebb.
    I have group Facebook and now i want to build a tool crawl all question from group to my website.
    In my VPS i have upgrade nodebb 1.14x to 1.18.4.
    But i cannot generate token to use v3/api of nodebb.
    Call API: POST
    https://domain.vn/api/v3/users/5866/tokens
    (5866 is my uid admin account) but got forbidden like picture below:
    Is that issue about CORS or session, admin setting?
    I found some docs talk about 2 type token (master and user token) but i not really understand them. Please help me make a sample to call my API create topic or post by Request package npm.

    Thank you a lot.

    744109d5-1319-421d-8b60-f775c5f17c85-image.png

  • 0 Votes
    1 Posts
    192 Views

    I just try to update the avatar, but it just request timeout error, and shows popup that connections is not ok.

    1.png
    2.png

  • Write API

    Technical Support
    1 Votes
    2 Posts
    342 Views

    Look this :

    import requests class auto_topic(): def __init__(self,api_url,bearer_token): self.api_url = api_url self.bearer_token = bearer_token def create(self,uid,cid,title,content): headers = {"Authorization": "Bearer %s"%self.bearer_token} topic = {'uid':uid,'cid':cid,'title':title,'content':content} response = requests.post(self.api_url,headers = headers,data=topic) return response
  • 0 Votes
    3 Posts
    705 Views

    Thank you for your answer. I have configured the CORS headers on my reverse proxy (nginx) and it works well now.

    Thank you!

  • 0 Votes
    3 Posts
    1k Views

    @rbeer That did the trick, thanks a bunch!