Getting an API key

I made Telegram: Contact @OSMdeWikiBot check for new topics in c/56 and tag/german via RSS and then notify Telegram: Contact @OSM_de of said new topics.

RSS makes the blanket access to the URL and the GUID easy, yet, without an API Key I am not allowed to access Discourse API Docs which would allow to show more information.

How do we manage API Keys for this Discourse (@nukeador ?)

Thx. Kai.

4 Likes

I can help too.

  1. API key tied to your user ok?

  2. Read Only ok?

1 Like

Thanks @Firefishy, read only is ok of course. I wonder, if it would make sense to tie the API key to a different user.

I do have one user for an automated edit in OSM and could easily create another one that’s just used for the API here.

That should be ok?

This is the account I’d like the API Key tied to :slight_smile:

My understanding was that users were able to create apis for their account without admin intervention

1 Like

Is User API keys specification - developers - Discourse Meta possibly turned off because I can’t see User API keys specification - developers - Discourse Meta (“Apps” in my settings?)

I see this

1 Like

That sounds very useful - it suggests that someone could create a reading / posting UI for this site that mirrored the old forum, and allowed people to participate without having to interact with (for example) the horrible tiny “reply” box that I’m typing this in right now : )

1 Like

Also themes can be created, maybe if enough people is motivated to have a more “old-school” UI, someone can create it, instead of a whole app using the API:

Also note that the “tiny” reply box can be resized, full screened or just changed to not display the preview panel on the right.

1 Like

The UI to do that is very poor, though. There are three visible on-screen controls - a left-pointing double chevron (with no label but a tooltip that says “hide preview”), a strange two-headed arrow (again no text, tooltip “enter fullscreen composer”). The third control just makes the reply disappear for no apparent reason. Hilariously, there is no reply button after clicking the strange two-headed arrow, so you have to click another (unlabelled) button to get that back.

There is one sane reply UI though - reply by email (if you turn on emails from the site and use it like a mailing list).

Well, the good thing is that there are options for everyone: tweakable web UI, RSS feeds, API, email… :wink:

2 Likes

Well this is interesting.

I used the Python script that’s linked in @nukeador 's second mentioned URL the generate a User-API-Key with the other account - and NOW I see “Apps” in the settings of that user where I could revoke said key, but I still don’t see the “Apps” setting under my “personal” user. Strange :slight_smile:

1 Like

From what I read, there is no way to get an API from the UI for users, that’s why someone created that script.

Good to know … Not that it was working when I called the endpoint (“you have no access to this resource, User API Key or Username incorrect”) but that’s a problem for future Kai.

This one worked for me: Generate user API key for Discourse / Robin van Boven | Observable

$ curl -X GET "https://community.openstreetmap.org/groups.json" -H "User-Api-Key: aabababababbabbabbabbabbbabbb832" 
{"groups":[{"id":42,"automatic":false,"name":"forums-governance","user_count":4,"mentionable_level":99,"messageable_level":99,"visibility_level":0,"primary_group":true,"title":"Forums governance team","grant_trust_level":4,"flair_url":"landmark","flair_bg_color":"EEE","flair_color":"666","bio_cooked":"<p>People who are helping with this forum governance. <a href=\"https://community.openstreetmap.org/t/which-governance-accountability-model-do-we-want-for-this-tool-who-and-how-should-decisions-being-made/220\">More info and discussion</a></p>","bio_excerpt":"People who are helping with this forum governance. <a href=\"https://community.openstreetmap.org/t/which-governance-accountability-model-do-we-want-for-this-tool-who-and-how-should-decisions-being-made/220\">More info and discussion</a>","public_admission":false,"public_exit":true,"allow_membership_requests":false,"full_name":"Forums governance team","default_notification_level":3,"membership_request_template":"","members_visibility_level":0,"can_see_members":true,"publish_read_state":false},{"id":2,"automatic":true,"name":"moderators","display_name":"Moderatoren","user_count":1,"mentionable_level":0,"messageable_level":99,"visibility_level":1,"primary_group":false,"title":null,"grant_trust_level":null,"flair_url":null,"flair_bg_color":null,"flair_color":null,"bio_cooked":null,"bio_excerpt":null,"public_admission":false,"public_exit":false,"allow_membership_requests":false,"full_name":null,"default_notification_level":2,"membership_request_template":null,"members_visibility_level":0,"can_see_members":true,"publish_read_state":false},{"id":56,"automatic":false,"name":"mods-argentina","user_count":3,"mentionable_level":99,"messageable_level":99,"visibility_level":
...

(User-Api-Key length matches the actual key length)

I have no idea how trustworthy the site is, though… :wink:

1 Like

@nukeador @Firefishy, the good @derFred was asking whether we can find a way to automatically post updates to the weeklyOSM team - a thread - as the API keys I can generate myself, albeit them not working properly as of right now, are read-only that wouldn’t help.

Would it be possible for any of you guys to create a write-access API Key to attach to a user that can post there?

Kai

1 Like

Uhm, I assumed the APi you got from the script had also write access.

@Firefishy do you know if this is possible or an admin needs to create a user one?

1 Like

Update OSM Software Watchlist gets updated automatically by @wambacher , maybe ask him how he posts updates…

2 Likes

ask him how he posts updates…

By hand :frowning:

thats why i need either an api-key or need to know how to post replies per e-mail.

asked for posting per e-mail but did not get any good answer.

Walter

I thought you did. Follow your own thread and post there to get an e-mail notification. Then answer to that per e-mail. Or is this not what you need?