Skip to content

Commit 969f360

Browse files
Add support for external_id in topic creation (#263)
* Add support for external_id in topic creation * add get_topic_url_by_external_id
1 parent d5ea30b commit 969f360

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/discourse_api/api/topics.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ def create_topic(args = {})
1111
API
1212
.params(args)
1313
.required(:title, :raw)
14-
.optional(:skip_validations, :category, :auto_track, :created_at, :api_username, :tags)
14+
.optional(
15+
:skip_validations,
16+
:category,
17+
:auto_track,
18+
:created_at,
19+
:api_username,
20+
:tags,
21+
:external_id,
22+
)
1523
post("/posts", args.to_h)
1624
end
1725

@@ -111,6 +119,10 @@ def bookmark_topic(topic_id)
111119
def remove_topic_bookmark(topic_id)
112120
put("/t/#{topic_id}/remove_bookmarks.json")
113121
end
122+
123+
def get_topic_url_by_external_id(external_id)
124+
get("/t/external_id/#{external_id}")
125+
end
114126
end
115127
end
116128
end

0 commit comments

Comments
 (0)