Find the reply key of a topic


(Thomas Schmit) #1

I’ve just set up reply via email and it’s working well!

Now, I would like to find the reply key of a topic without receiving a notification by mail. How can it be done ?

Thanks for you help :slight_smile:


(Allen - Watchman Monitoring) #2

Who’s reply key? What problem are you trying to solve?


(Thomas Schmit) #3

Are reply keys unique?

I’d like to create a bot account and allow him to post in a specific topic via mail. Do you see what I mean?


(Louis Rossouw) #4

Why not rather use the API:


(Thomas Schmit) #5

It’d be more complicated because the mailing system already exist.


(Louis Rossouw) #6

Your way:

  1. Create a user on the forum for the bot.
  2. Create an email acocunt for bot.
  3. Subscribe the bot to email on the thread.
  4. Post on the thread with another user.
  5. Wait for an email to bot.
  6. Use key in reply.
  7. Redo when key expires.

My way:

  1. Create forum user for bot.
  2. Assign API key
  3. Find topic number of thread (see as per URL)
  4. Do a POST with raw post and topic_id (and API key).

(Louis Rossouw) #7

This is from my bot in python:

import requests
import config

def postdiscourse(msg):
    payload={
	'topic_id': config.discoursetopicid
	,'raw': msg
	}
    url=config.discourseurl+'?api_key='+config.discourseapikey+'&api_username='+config.discourseuser
    r = requests.post(url=url, data=payload)

postdiscourse('This is a test post to show how it works.')

This would post to the forum at config.discourseurl and into the topic config.discoursetopicid using the relevant API key and user.