Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Articles UI/API not working #9431

Open
aapeliv opened this issue May 7, 2024 · 2 comments
Open

Articles UI/API not working #9431

aapeliv opened this issue May 7, 2024 · 2 comments
Labels

Comments

@aapeliv
Copy link

aapeliv commented May 7, 2024

Describe the bug

I've set up a self-hosted Chatwoot instance on docker compose with nginx reverse proxy based on the v3.8.0-ce docker tag. You can see the setup here: https://github.com/Couchers-org/tools

I'm trying to create articles in a help center. I'm running into three issues:

  1. The UI was at first not showing any articles. I could create them and they'd show up in the help center (like on the logged out viewer side). I created a category and suddenly the articles were visible.
  2. The API is returning "null"s in places of counts:
requests.get(
    f"https://our.domain/api/v1/accounts/2/portals",
    headers={"api_access_token": CHATWOOT_API_TOKEN}
).text
{
  "payload": [
    {
      "id": 1,
      "color": "#E47701",
      "custom_domain": null,
      "header_text": "",
      "homepage_link": "https://couchers.org",
      "name": "Couchers.org Help Center",
      "page_title": "Couchers.org Help Center",
      "slug": "couchersorg-help-center",
      "archived": false,
      "account_id": 2,
      "config": {
        "allowed_locales": [
          {
            "code": "en",
            "articles_count": 3,
            "categories_count": 4
          }
        ]
      },
      "logo": {
        // snip
      },
      "meta": {
        "all_articles_count": 0,
        "archived_articles_count": null,
        "published_count": null,
        "draft_articles_count": null,
        "categories_count": 4,
        "default_locale": "en"
      }
    }
  ],
  "meta": {
    "current_page": 1,
    "portals_count": 1
  }
}
  1. I'm unable to create new articles:
requests.post(
    f"https://our.domain/api/v1/accounts/2/portals/1/articles",
    json={
          "content": "testing",
          "title": "test article",
        },
    headers={"api_access_token": CHATWOOT_API_TOKEN}
).text
{"error":"Resource could not be found"}

To Reproduce

Config: https://github.com/Couchers-org/tools

See above

Expected behavior

No response

Environment

Docker

Cloud Provider

AWS

Platform

Browser

Operating system

Ubuntu

Browser and version

FF

Docker (if applicable)

No response

Additional context

No response

@aapeliv aapeliv added the Bug label May 7, 2024
Copy link

linear bot commented May 7, 2024

@aapeliv
Copy link
Author

aapeliv commented May 7, 2024

OK, so I have solved 3 by using https://our.domain/api/v1/accounts/2/portals/{portal_slug}/articles where I use the {portal_slug} instead of {portal_id} as it says in the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant