Mastodon: How to get STREAMING_API_BASE_URL from API?

Created on 18 Apr 2017  路  4Comments  路  Source: tootsuite/mastodon

I'm API user.
Streaming API and others may be different.

for example, mstdn.jp api is
streaming api: https://streaming.mstdn.jp/api/v1/streaming
other apis: https://mstdn.jp/api/v1
https://mstdn.jp/@nullkal/308338

I would like to get STREAMING_API_BASE_URL automatically.
But, there seems no api to get in https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md

How to get it from API?


  • [x] I searched or browsed the repo鈥檚 other issues to ensure this is not a duplicate.
  • [x] This bug happens on a tagged release and not on master (If you're a user, don't worry about this).
api

Most helpful comment

This is pretty unfortunate, but the STREAMING_API_BASE_URL was intended for deveopment environments where you wouldn't have nginx and the streaming API could run on a random port... So we have no mechanism of communicating if this URL is non-standard. I suppose this is something that will need to be in GET /api/v1/instance

All 4 comments

I have same issue.
How to know ( STREAMING_API_BASE_URL in .env.production ) via API ?

This is pretty unfortunate, but the STREAMING_API_BASE_URL was intended for deveopment environments where you wouldn't have nginx and the streaming API could run on a random port... So we have no mechanism of communicating if this URL is non-standard. I suppose this is something that will need to be in GET /api/v1/instance

Currently, mstdn.jp does 301 redirect to https://streaming.mstdn.jp/api/v1/streaming/ when we access https://mstdn.jp/api/v1/streaming/.
So, Apps using Streaming API must deal with 301 redirect for the time being.

This problem is that some values stored in initial-state isn't accessible via api I think.

It is now returned from /api/v1/instance

Was this page helpful?
0 / 5 - 0 ratings