API not working

(Wes Fisher) #1

I’m trying to get the API setup so I can do some custom Ruby scripting and I’m following this:

I populate all my Discourse information inside examples/example.rb, but when I run it, this happens:

home/praetor/discourse_api/lib/discourse_api/client.rb:125:in `rescue in request': execution expired (DiscourseApi::Error)
from /home/praetor/discourse_api/lib/discourse_api/client.rb:118:in `request'
from /home/praetor/discourse_api/lib/discourse_api/client.rb:72:in `get'
from /home/praetor/discourse_api/lib/discourse_api/api/topics.rb:27:in `latest_topics'
from example.rb:9:in `<main>'

I’m not sure why :frowning: If anyone can help, that would be appreciated.

(Matt Palmer) #2

“execution expired” suggests that you’re probably not successfully making a connection to the server (in theory, it could be that the server is overloaded, but you’d presumably notice that in ordinary browsing). Double-check that your hostname, port, etc are all correct, and try a manual curl command to the server from wherever you’re running the script, to check firewalling.

(Wes Fisher) #3

Yeah. The server is up and working just fine. It’s listening on port 80 and 443.

I can fetch the latest posts via curl

The server has a let’s encrypt certificate. Is there anything special one must do for SSL? I’m throwing things at the wall :stuck_out_tongue: