{"post_stream":{"posts":[{"id":1042752,"name":"cmdntd","username":"cmdntd","avatar_template":"/user_avatar/meta.discourse.org/cmdntd/{size}/192008_2.png","created_at":"2022-01-14T11:07:50.184Z","cooked":"\u003cblockquote\u003e\n\u003cp\u003eI try to do like Sam’s instruction at \u003ca href=\"https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576\"\u003eHow to reverse engineer the Discourse API\u003c/a\u003e\u003cbr\u003e\nBut it display 2 IDs, and it makes me do not know how to do next\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eWhen I tried to update private message, it has different 2 IDs:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eID of private message\u003c/li\u003e\n\u003cli\u003eID with bigger number (like a ID for edit private message)\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003e\u003cdiv class=\"lightbox-wrapper\"\u003e\u003ca class=\"lightbox\" href=\"https://d11a6trkgmumsb.cloudfront.net/original/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd.png\" data-download-href=\"/uploads/short-url/vGMtMOVNnyR5jfKkGS7e1Q3siTj.png?dl=1\" title=\"6jLZwKRZd3\" rel=\"noopener nofollow ugc\"\u003e\u003cimg src=\"https://d11a6trkgmumsb.cloudfront.net/original/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd.png\" alt=\"6jLZwKRZd3\" data-base62-sha1=\"vGMtMOVNnyR5jfKkGS7e1Q3siTj\" width=\"690\" height=\"218\" data-dominant-color=\"F4F3F4\"\u003e\u003cdiv class=\"meta\"\u003e\u003csvg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"\u003e\u003cuse href=\"#far-image\"\u003e\u003c/use\u003e\u003c/svg\u003e\u003cspan class=\"filename\"\u003e6jLZwKRZd3\u003c/span\u003e\u003cspan class=\"informations\"\u003e1002×318 18.3 KB\u003c/span\u003e\u003csvg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"\u003e\u003cuse href=\"#discourse-expand\"\u003e\u003c/use\u003e\u003c/svg\u003e\u003c/div\u003e\u003c/a\u003e\u003c/div\u003e\u003c/p\u003e\n\u003cp\u003eWhen I test to send PUT request, ID of private message just can change title. And can not change message details by “raw”\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eIt seems message details must change by new edit ID\u003c/strong\u003e\u003cbr\u003e\n\u003cstrong\u003eAnd I do not know how to get the second ID of the post (1846 in image)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eCould you explain for this issue?\u003c/p\u003e","post_number":1,"post_type":1,"posts_count":3,"updated_at":"2023-10-15T08:03:52.724Z","reply_count":1,"reply_to_post_number":null,"quote_count":0,"incoming_link_count":38,"reads":15,"readers_count":14,"score":213.0,"yours":false,"topic_id":214844,"topic_slug":"there-are-2-ids-when-i-try-to-get-api-in-case-of-lack-documentation","display_username":"cmdntd","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":2,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"link_counts":[{"url":"https://meta.discourse.org/t/reverse-engineer-the-discourse-api/20576","internal":true,"reflection":false,"title":"Reverse engineer the Discourse API","clicks":0},{"url":"https://d11a6trkgmumsb.cloudfront.net/original/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd.png","internal":false,"reflection":false,"title":"de196de5f6187c4c0cd01b28d9d083d2cff4acbd.png","clicks":0}],"read":true,"user_title":"","bookmarked":false,"actions_summary":[{"id":2,"count":1}],"moderator":false,"admin":false,"staff":false,"user_id":83556,"hidden":false,"trust_level":2,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/there-are-2-ids-when-i-try-to-get-api-in-case-of-lack-documentation/214844/1","locale":"en","is_localized":false,"language":"en","activity_pub_enabled":false,"boosts":[],"can_boost":false,"event":null,"calendar_details":[],"customer_flair_customer":null,"reactions":[{"id":"heart","type":"emoji","count":1}],"current_user_reaction":null,"reaction_users_count":1,"current_user_used_main_reaction":false,"can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":true,"can_vote":false},{"id":1042834,"name":"Jay Pfaffman","username":"pfaffman","avatar_template":"/user_avatar/meta.discourse.org/pfaffman/{size}/120154_2.png","created_at":"2022-01-14T14:37:27.534Z","cooked":"\u003caside class=\"quote no-group\" data-username=\"cmdntd\" data-post=\"1\" data-topic=\"214844\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/cmdntd/48/192008_2.png\" class=\"avatar\"\u003e cmdntd:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cul\u003e\n\u003cli\u003eID of private message\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eThat’s the \u003ccode\u003etopic.id\u003c/code\u003e\u003c/p\u003e\n\u003caside class=\"quote no-group\" data-username=\"cmdntd\" data-post=\"1\" data-topic=\"214844\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/cmdntd/48/192008_2.png\" class=\"avatar\"\u003e cmdntd:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003col\u003e\n\u003cli\u003eID with bigger number (like a ID for edit private message)\u003c/li\u003e\n\u003c/ol\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eThat’s the \u003ccode\u003epost.id\u003c/code\u003e\u003c/p\u003e\n\u003caside class=\"quote no-group\" data-username=\"cmdntd\" data-post=\"1\" data-topic=\"214844\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/cmdntd/48/192008_2.png\" class=\"avatar\"\u003e cmdntd:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eWhen I test to send PUT request, ID of private message just can change title. And can not change message details by “raw”\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eThe title is part of the topic, \u003ccode\u003eraw\u003c/code\u003e is part of the post. If you look closely in the post, you’ll see a \u003ccode\u003etopic_id\u003c/code\u003e field that contains the number that you’re calling the private message ID.\u003c/p\u003e\n\u003cp\u003eYou can have a look here: \u003ca href=\"https://meta.discourse.org/t/there-are-2-ids-when-i-try-to-get-api-in-case-of-lack-documentation/214844.json\" class=\"inline-onebox\"\u003eThere are 2 IDs when I try to get API, in case of lack documentation\u003c/a\u003e (that’s this topic, but it’s the same as  PM) and see:\u003c/p\u003e\n\u003cp\u003e\u003cdiv class=\"lightbox-wrapper\"\u003e\u003ca class=\"lightbox\" href=\"https://d11a6trkgmumsb.cloudfront.net/original/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501.png\" data-download-href=\"/uploads/short-url/5EeI1v6XPXyTI3gjsL5CQ9ogZhf.png?dl=1\" title=\"image\"\u003e\u003cimg src=\"https://d11a6trkgmumsb.cloudfront.net/optimized/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501_2_661x500.png\" alt=\"image\" data-base62-sha1=\"5EeI1v6XPXyTI3gjsL5CQ9ogZhf\" width=\"661\" height=\"500\" srcset=\"https://d11a6trkgmumsb.cloudfront.net/optimized/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501_2_661x500.png, https://d11a6trkgmumsb.cloudfront.net/original/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501.png 1.5x, https://d11a6trkgmumsb.cloudfront.net/original/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501.png 2x\" data-dominant-color=\"F3F7F3\"\u003e\u003cdiv class=\"meta\"\u003e\u003csvg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"\u003e\u003cuse href=\"#far-image\"\u003e\u003c/use\u003e\u003c/svg\u003e\u003cspan class=\"filename\"\u003eimage\u003c/span\u003e\u003cspan class=\"informations\"\u003e851×643 96.3 KB\u003c/span\u003e\u003csvg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"\u003e\u003cuse href=\"#discourse-expand\"\u003e\u003c/use\u003e\u003c/svg\u003e\u003c/div\u003e\u003c/a\u003e\u003c/div\u003e\u003c/p\u003e\n\u003cp\u003eSo that’s the \u003ccode\u003epost_id\u003c/code\u003e is what you’ll use to POST changes to \u003ccode\u003eraw\u003c/code\u003e. The \u003ccode\u003etopic_id\u003c/code\u003e is where you change the title.\u003c/p\u003e","post_number":2,"post_type":1,"posts_count":3,"updated_at":"2022-01-14T14:38:26.938Z","reply_count":0,"reply_to_post_number":null,"quote_count":1,"incoming_link_count":3,"reads":11,"readers_count":10,"score":92.2,"yours":false,"topic_id":214844,"topic_slug":"there-are-2-ids-when-i-try-to-get-api-in-case-of-lack-documentation","display_username":"Jay Pfaffman","primary_group_name":null,"flair_name":"support-experts","flair_url":"https://d11a6trkgmumsb.cloudfront.net/original/3X/e/2/e250ec403580530d19e6a9ed42d0d525a51a9dbe.svg","flair_bg_color":"FFFFFF","flair_color":"","flair_group_id":142,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"link_counts":[{"url":"https://d11a6trkgmumsb.cloudfront.net/original/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501.png","internal":false,"reflection":false,"title":"2797446e89d14d74c994d04cdc831b36b6c0f501.png","clicks":0}],"read":true,"user_title":"Support Expert","title_is_group":false,"bookmarked":false,"actions_summary":[{"id":2,"count":3}],"moderator":false,"admin":false,"staff":false,"user_id":15209,"hidden":false,"trust_level":4,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"post_url":"/t/there-are-2-ids-when-i-try-to-get-api-in-case-of-lack-documentation/214844/2","locale":"en","is_localized":false,"language":"en","activity_pub_enabled":false,"boosts":[],"can_boost":false,"event":null,"customer_flair_customer":null,"reactions":[{"id":"heart","type":"emoji","count":3}],"current_user_reaction":null,"reaction_users_count":3,"current_user_used_main_reaction":false,"can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":true,"topic_accepted_answer":true},{"id":1058613,"name":"system","username":"system","avatar_template":"/user_avatar/meta.discourse.org/system/{size}/443519_2.png","created_at":"2022-02-13T14:37:56.300Z","cooked":"\u003cp\u003eThis topic was automatically closed 30 days after the last reply. New replies are no longer allowed.\u003c/p\u003e","post_number":3,"post_type":3,"posts_count":3,"updated_at":"2022-02-13T14:37:56.300Z","reply_count":0,"reply_to_post_number":null,"quote_count":0,"incoming_link_count":1,"reads":2,"readers_count":1,"score":5.4,"yours":false,"topic_id":214844,"topic_slug":"there-are-2-ids-when-i-try-to-get-api-in-case-of-lack-documentation","display_username":"system","primary_group_name":null,"flair_name":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"flair_group_id":null,"badges_granted":[],"version":1,"can_edit":false,"can_delete":false,"can_recover":false,"can_see_hidden_post":false,"can_wiki":false,"read":true,"user_title":null,"bookmarked":false,"actions_summary":[],"moderator":true,"admin":true,"staff":true,"user_id":-1,"hidden":false,"trust_level":4,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"action_code":"autoclosed.enabled","post_url":"/t/there-are-2-ids-when-i-try-to-get-api-in-case-of-lack-documentation/214844/3","locale":null,"is_localized":false,"activity_pub_enabled":false,"boosts":[],"can_boost":false,"event":null,"customer_flair_customer":null,"reactions":[],"current_user_reaction":null,"reaction_users_count":0,"current_user_used_main_reaction":false,"can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"topic_accepted_answer":true}],"stream":[1042752,1042834,1058613]},"timeline_lookup":[[1,1547],[2,1546],[3,1516]],"suggested_topics":[],"tags":[{"id":330,"name":"rest-api","slug":"rest-api"}],"tags_descriptions":{"rest-api":"Темы, касающиеся выполнения внешних запросов к Discourse"},"fancy_title":"There are 2 IDs when I try to get API, in case of lack documentation","fancy_title_localized":false,"locale":"en","id":214844,"title":"There are 2 IDs when I try to get API, in case of lack documentation","posts_count":3,"created_at":"2022-01-14T11:07:50.065Z","views":832,"reply_count":0,"like_count":4,"last_posted_at":"2022-01-14T14:37:27.534Z","visible":true,"closed":true,"archived":false,"has_summary":false,"archetype":"regular","slug":"there-are-2-ids-when-i-try-to-get-api-in-case-of-lack-documentation","category_id":7,"word_count":329,"deleted_at":null,"user_id":83556,"featured_link":null,"pinned_globally":false,"pinned_at":null,"pinned_until":null,"image_url":"https://d11a6trkgmumsb.cloudfront.net/original/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd.png","slow_mode_seconds":0,"draft":null,"draft_key":"topic_214844","draft_sequence":null,"unpinned":null,"pinned":false,"current_post_number":1,"highest_post_number":3,"deleted_by":null,"actions_summary":[{"id":4,"count":0,"hidden":false,"can_act":false},{"id":8,"count":0,"hidden":false,"can_act":false},{"id":10,"count":0,"hidden":false,"can_act":false},{"id":7,"count":0,"hidden":false,"can_act":false},{"id":1002,"count":0,"hidden":false,"can_act":false}],"chunk_size":20,"bookmarked":false,"topic_timer":null,"message_bus_last_id":0,"participant_count":2,"show_read_indicator":false,"thumbnails":[{"max_width":null,"max_height":null,"width":1002,"height":318,"url":"https://d11a6trkgmumsb.cloudfront.net/original/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd.png"},{"max_width":800,"max_height":800,"width":800,"height":253,"url":"https://d11a6trkgmumsb.cloudfront.net/optimized/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd_2_800x253.png"},{"max_width":600,"max_height":600,"width":600,"height":190,"url":"https://d11a6trkgmumsb.cloudfront.net/optimized/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd_2_600x190.png"},{"max_width":400,"max_height":400,"width":400,"height":126,"url":"https://d11a6trkgmumsb.cloudfront.net/optimized/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd_2_400x126.png"},{"max_width":300,"max_height":300,"width":300,"height":95,"url":"https://d11a6trkgmumsb.cloudfront.net/optimized/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd_2_300x95.png"},{"max_width":200,"max_height":200,"width":200,"height":63,"url":"https://d11a6trkgmumsb.cloudfront.net/optimized/3X/d/e/de196de5f6187c4c0cd01b28d9d083d2cff4acbd_2_200x63.png"}],"slow_mode_enabled_until":null,"has_localized_content":false,"activity_pub_enabled":null,"related_topics":[{"fancy_title":"How to update a private message by API?","fancy_title_localized":false,"locale":"en","id":214290,"title":"How to update a private message by API?","slug":"how-to-update-a-private-message-by-api","posts_count":4,"reply_count":3,"highest_post_number":4,"image_url":null,"created_at":"2022-01-09T11:23:38.141Z","last_posted_at":"2022-01-09T12:06:31.982Z","bumped":true,"bumped_at":"2022-01-14T10:58:12.107Z","archetype":"regular","unseen":false,"pinned":false,"unpinned":null,"excerpt":"It seems not have API to update private message \nhttps://docs.discourse.org/#operation/createTopicPostPM \nI want to update a private message \nCould I use PUT topic to do it? Do you have any idea to update private message\u0026hellip;","visible":true,"closed":false,"archived":false,"bookmarked":null,"liked":null,"thumbnails":null,"tags":[{"id":330,"name":"rest-api","slug":"rest-api"}],"tags_descriptions":{"rest-api":"Темы, касающиеся выполнения внешних запросов к Discourse"},"like_count":3,"views":946,"category_id":7,"featured_link":null,"op_like_count":0,"ai_topic_gist":null,"has_accepted_answer":false,"posters":[{"extras":"latest","description":"Исходный автор, Последний автор","user":{"id":83556,"username":"cmdntd","name":"cmdntd","avatar_template":"/user_avatar/meta.discourse.org/cmdntd/{size}/192008_2.png","trust_level":2}},{"extras":null,"description":"Частый автор","user":{"id":15209,"username":"pfaffman","name":"Jay Pfaffman","avatar_template":"/user_avatar/meta.discourse.org/pfaffman/{size}/120154_2.png","flair_name":"support-experts","flair_url":"https://d11a6trkgmumsb.cloudfront.net/original/3X/e/2/e250ec403580530d19e6a9ed42d0d525a51a9dbe.svg","flair_bg_color":"FFFFFF","flair_group_id":142,"trust_level":4}}]},{"fancy_title":"Can\u0026rsquo;t update a topic\u0026rsquo;s body by API","fancy_title_localized":false,"locale":"en","id":264640,"title":"Can't update a topic's body by API","slug":"cant-update-a-topics-body-by-api","posts_count":5,"reply_count":2,"highest_post_number":5,"image_url":null,"created_at":"2023-05-11T12:05:50.150Z","last_posted_at":"2023-05-11T16:11:39.711Z","bumped":true,"bumped_at":"2023-05-11T16:21:30.248Z","archetype":"regular","unseen":false,"pinned":false,"unpinned":null,"excerpt":"I did follow the docs and， however, it only update the topic’s title, without updating the body. \nMy code (Javascript): \nasync function updateDiscourseTopic(topic_id) {\n  const Discourse_API_Key = \u0026quot;Discourse_API_Key\u0026quot;;\n  \u0026hellip;","visible":true,"closed":true,"archived":false,"bookmarked":null,"liked":null,"thumbnails":null,"tags":[{"id":330,"name":"rest-api","slug":"rest-api"}],"tags_descriptions":{"rest-api":"Темы, касающиеся выполнения внешних запросов к Discourse"},"like_count":9,"views":386,"category_id":7,"featured_link":null,"op_like_count":0,"ai_topic_gist":"Updating a topic's body via API requires sending a separate PUT request to the first post, not the topic itself, and the post ID can be retrieved using the Discourse API's `posts.json` endpoint.","has_accepted_answer":true,"posters":[{"extras":"latest","description":"Исходный автор, Последний автор","user":{"id":132407,"username":"Dotila_Li","name":"","avatar_template":"/user_avatar/meta.discourse.org/dotila_li/{size}/303426_2.png","trust_level":2}},{"extras":null,"description":"Частый автор, Принятый ответ","user":{"id":35474,"username":"Canapin","name":"Coin-coin le Canapin","avatar_template":"/user_avatar/meta.discourse.org/canapin/{size}/119591_2.png","trust_level":3}},{"extras":null,"description":"Частый автор","user":{"id":127856,"username":"Lilly","name":"","avatar_template":"/user_avatar/meta.discourse.org/lilly/{size}/548787_2.png","trust_level":3}},{"extras":null,"description":"Частый автор","user":{"id":-1,"username":"system","name":"system","avatar_template":"/user_avatar/meta.discourse.org/system/{size}/443519_2.png","admin":true,"moderator":true,"trust_level":4}}]},{"fancy_title":"Get ID for updating a post","fancy_title_localized":false,"locale":null,"id":47095,"title":"Get ID for updating a post","slug":"get-id-for-updating-a-post","posts_count":2,"reply_count":1,"highest_post_number":2,"image_url":null,"created_at":"2016-07-11T13:41:25.745Z","last_posted_at":"2016-07-11T14:08:54.967Z","bumped":true,"bumped_at":"2024-01-17T21:52:38.775Z","archetype":"regular","unseen":false,"pinned":false,"unpinned":null,"excerpt":"When creating a new category, I must have an automatically created post, as: Every category has an initial \u0026quot;About this category\u0026quot; topic. So, I use the API to create the \u0026#39;group one\u0026#39; category, then I get the topic-url from \u0026hellip;","visible":true,"closed":false,"archived":false,"bookmarked":null,"liked":null,"thumbnails":null,"tags":[],"tags_descriptions":{},"like_count":5,"views":1063,"category_id":7,"featured_link":null,"op_like_count":0,"ai_topic_gist":"The user asks for a reliable method to obtain the post ID for updating the default \"About this category\" topic, and another user suggests retrieving it directly from the topic JSON endpoint instead of relying on the unreliable id + 3 pattern.","has_accepted_answer":false,"posters":[{"extras":null,"description":"Исходный автор","user":{"id":21023,"username":"nisbeti","name":"Nisbeti","avatar_template":"/user_avatar/meta.discourse.org/nisbeti/{size}/121678_2.png","trust_level":1}},{"extras":"latest","description":"Последний автор","user":{"id":14750,"username":"Tom_Newsom","name":"Tom Newsom","avatar_template":"/user_avatar/meta.discourse.org/tom_newsom/{size}/115981_2.png","trust_level":2}}]},{"fancy_title":"Issue in post creation API","fancy_title_localized":false,"locale":"en","id":201667,"title":"Issue in post creation API","slug":"issue-in-post-creation-api","posts_count":2,"reply_count":0,"highest_post_number":2,"image_url":null,"created_at":"2021-08-25T11:57:45.772Z","last_posted_at":"2021-08-26T05:15:30.337Z","bumped":true,"bumped_at":"2021-08-26T05:15:30.337Z","archetype":"regular","unseen":false,"pinned":false,"unpinned":null,"excerpt":"I am working on this forum which is powered by Discourse. After the moderators provided me with an api key and username, I found a bug in the POST /posts.json API endpoint. \nAs mentioned here this endpoint accepts a topi\u0026hellip;","visible":true,"closed":false,"archived":false,"bookmarked":null,"liked":null,"thumbnails":null,"tags":[{"id":330,"name":"rest-api","slug":"rest-api"}],"tags_descriptions":{"rest-api":"Темы, касающиеся выполнения внешних запросов к Discourse"},"like_count":1,"views":475,"category_id":7,"featured_link":null,"op_like_count":0,"ai_topic_gist":null,"has_accepted_answer":false,"posters":[{"extras":null,"description":"Исходный автор","user":{"id":103651,"username":"nishantwrp","name":"Nishant Mittal","avatar_template":"/user_avatar/meta.discourse.org/nishantwrp/{size}/232189_2.png","trust_level":0}},{"extras":"latest","description":"Последний автор","user":{"id":1,"username":"sam","name":"Sam Saffron","avatar_template":"/user_avatar/meta.discourse.org/sam/{size}/102149_2.png","primary_group_name":"team","flair_name":"team","flair_url":"https://d11a6trkgmumsb.cloudfront.net/original/3X/e/b/ebee30bd98aef20357e4a177a5a1e45b877ce088.svg","flair_color":"111","flair_group_id":47,"admin":true,"trust_level":3}}]},{"fancy_title":"Replying to PM via API not working anymore","fancy_title_localized":false,"locale":"en","id":145037,"title":"Replying to PM via API not working anymore","slug":"replying-to-pm-via-api-not-working-anymore","posts_count":5,"reply_count":1,"highest_post_number":5,"image_url":null,"created_at":"2020-03-21T12:09:58.993Z","last_posted_at":"2020-04-20T17:57:57.682Z","bumped":true,"bumped_at":"2020-03-21T17:57:45.902Z","archetype":"regular","unseen":false,"pinned":false,"unpinned":null,"excerpt":"I’ve noticed there was a fix to discourse almost a month ago where you can’t create a PM on an existing topic anymore. I never knew this was the issue at all. But it seems this fix “broke” the ability to reply to PM mess\u0026hellip;","visible":true,"closed":true,"archived":false,"bookmarked":null,"liked":null,"thumbnails":null,"tags":[],"tags_descriptions":{},"like_count":12,"views":973,"category_id":6,"featured_link":null,"op_like_count":1,"ai_topic_gist":"Replying to a PM via API is fixed by setting archetype to \"regular\" instead of \"private_message\" when responding to an existing private message topic.","has_accepted_answer":true,"posters":[{"extras":null,"description":"Исходный автор, Принятый ответ","user":{"id":66444,"username":"Rina_Fallingstar","name":"Rina Fallingstar","avatar_template":"/user_avatar/meta.discourse.org/rina_fallingstar/{size}/168391_2.png","trust_level":1}},{"extras":null,"description":"Частый автор","user":{"id":15209,"username":"pfaffman","name":"Jay Pfaffman","avatar_template":"/user_avatar/meta.discourse.org/pfaffman/{size}/120154_2.png","flair_name":"support-experts","flair_url":"https://d11a6trkgmumsb.cloudfront.net/original/3X/e/2/e250ec403580530d19e6a9ed42d0d525a51a9dbe.svg","flair_bg_color":"FFFFFF","flair_group_id":142,"trust_level":4}},{"extras":null,"description":"Частый автор","user":{"id":22774,"username":"Overgrow","name":"","avatar_template":"/user_avatar/meta.discourse.org/overgrow/{size}/478189_2.png","trust_level":2}},{"extras":"latest","description":"Последний автор","user":{"id":-1,"username":"system","name":"system","avatar_template":"/user_avatar/meta.discourse.org/system/{size}/443519_2.png","admin":true,"moderator":true,"trust_level":4}}]}],"summarizable":true,"has_cached_summary":true,"is_nested_view":null,"valid_reactions":["heart","laughing","cry","exploding_head","clap","confetti_ball","hugs","chefs_kiss","100","+1","rocket","star_struck","discourse","eyes"],"accepted_answer":{"post_number":2,"username":"pfaffman","name":"Jay Pfaffman","avatar_template":"/user_avatar/meta.discourse.org/pfaffman/{size}/120154_2.png","excerpt":"\u003caside class=\"quote no-group\" data-username=\"cmdntd\" data-post=\"1\" data-topic=\"214844\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/cmdntd/48/192008_2.png\" class=\"avatar\"\u003e cmdntd:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cul\u003e\n\u003cli\u003eID of private message\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eThat’s the \u003ccode\u003etopic.id\u003c/code\u003e\u003c/p\u003e\n\u003caside class=\"quote no-group\" data-username=\"cmdntd\" data-post=\"1\" data-topic=\"214844\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/cmdntd/48/192008_2.png\" class=\"avatar\"\u003e cmdntd:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003col\u003e\n\u003cli\u003eID with bigger number (like a ID for edit private message)\u003c/li\u003e\n\u003c/ol\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eThat’s the \u003ccode\u003epost.id\u003c/code\u003e\u003c/p\u003e\n\u003caside class=\"quote no-group\" data-username=\"cmdntd\" data-post=\"1\" data-topic=\"214844\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg loading=\"lazy\" alt=\"\" width=\"24\" height=\"24\" src=\"https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/cmdntd/48/192008_2.png\" class=\"avatar\"\u003e cmdntd:\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eWhen I test to send PUT request, ID of private message just can change title. And can not change message details by “raw”\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eThe title is part of the topic, \u003ccode\u003eraw\u003c/code\u003e is part of the post. If you look closely in the post, you’ll see a \u003ccode\u003etopic_id\u003c/code\u003e field that contains the number that you’re calling the private message ID.\u003c/p\u003e\n\u003cp\u003eYou can have a look here: \u003ca href=\"https://meta.discourse.org/t/there-are-2-ids-when-i-try-to-get-api-in-case-of-lack-documentation/214844.json\" class=\"inline-onebox\"\u003eThere are 2 IDs when I try to get API, in case of lack documentation\u003c/a\u003e (that’s this topic, but it’s the same as  PM) and see:\u003c/p\u003e\n\u003cp\u003e\u003cdiv class=\"lightbox-wrapper\"\u003e\u003ca class=\"lightbox\" href=\"https://d11a6trkgmumsb.cloudfront.net/original/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501.png\" data-download-href=\"/uploads/short-url/5EeI1v6XPXyTI3gjsL5CQ9ogZhf.png?dl=1\" title=\"image\"\u003e\u003cimg src=\"https://d11a6trkgmumsb.cloudfront.net/optimized/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501_2_661x500.png\" alt=\"image\" data-base62-sha1=\"5EeI1v6XPXyTI3gjsL5CQ9ogZhf\" width=\"661\" height=\"500\" srcset=\"https://d11a6trkgmumsb.cloudfront.net/optimized/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501_2_661x500.png, https://d11a6trkgmumsb.cloudfront.net/original/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501.png 1.5x, https://d11a6trkgmumsb.cloudfront.net/original/3X/2/7/2797446e89d14d74c994d04cdc831b36b6c0f501.png 2x\" data-dominant-color=\"F3F7F3\"\u003e\u003cdiv class=\"meta\"\u003e\u003csvg class=\"fa d-icon d-icon-far-image svg-icon\" aria-hidden=\"true\"\u003e\u003cuse href=\"#far-image\"\u003e\u003c/use\u003e\u003c/svg\u003e\u003cspan class=\"filename\"\u003eimage\u003c/span\u003e\u003cspan class=\"informations\"\u003e851×643 96.3 KB\u003c/span\u003e\u003csvg class=\"fa d-icon d-icon-discourse-expand svg-icon\" aria-hidden=\"true\"\u003e\u003cuse href=\"#discourse-expand\"\u003e\u003c/use\u003e\u003c/svg\u003e\u003c/div\u003e\u003c/a\u003e\u003c/div\u003e\u003c/p\u003e\n\u003cp\u003eSo that’s the \u003ccode\u003epost_id\u003c/code\u003e is what you’ll use to POST changes to \u003ccode\u003eraw\u003c/code\u003e. The \u003ccode\u003etopic_id\u003c/code\u003e is where you change the title.\u003c/p\u003e","accepter_name":"cmdntd","accepter_username":"cmdntd"},"can_vote":false,"vote_count":0,"user_voted":false,"discourse_zendesk_plugin_zendesk_id":null,"discourse_zendesk_plugin_zendesk_url":"https://your-url.zendesk.com/agent/tickets/","details":{"can_edit":false,"notification_level":1,"participants":[{"id":15209,"username":"pfaffman","name":"Jay Pfaffman","avatar_template":"/user_avatar/meta.discourse.org/pfaffman/{size}/120154_2.png","post_count":1,"primary_group_name":null,"flair_name":"support-experts","flair_url":"https://d11a6trkgmumsb.cloudfront.net/original/3X/e/2/e250ec403580530d19e6a9ed42d0d525a51a9dbe.svg","flair_color":"","flair_bg_color":"FFFFFF","flair_group_id":142,"trust_level":4},{"id":83556,"username":"cmdntd","name":"cmdntd","avatar_template":"/user_avatar/meta.discourse.org/cmdntd/{size}/192008_2.png","post_count":1,"primary_group_name":null,"flair_name":null,"flair_url":null,"flair_color":null,"flair_bg_color":null,"flair_group_id":null,"trust_level":2}],"created_by":{"id":83556,"username":"cmdntd","name":"cmdntd","avatar_template":"/user_avatar/meta.discourse.org/cmdntd/{size}/192008_2.png"},"last_poster":{"id":15209,"username":"pfaffman","name":"Jay Pfaffman","avatar_template":"/user_avatar/meta.discourse.org/pfaffman/{size}/120154_2.png"}},"bookmarks":[]}