mastodon-api icon indicating copy to clipboard operation
mastodon-api copied to clipboard

Support for public API

Open jaller94 opened this issue 6 years ago • 3 comments

As mentioned in Mastodon’s documentation some API endpoints do not require an authentication. (e.g. statuses/:id)

https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#timelines

If I try to create a Mastodon object without a an access_token I get the following error:

./node_modules/mastodon-api/lib/mastodon.js:345
                    throw new Error('Mastodon config must include \'' + reqKey + '\' when using \'user_auth\'');
                    ^

Error: Mastodon config must include 'access_token' when using 'user_auth'

Is it possible to make unauthorized API calls?

jaller94 avatar May 14 '18 04:05 jaller94

Yes, just pass a dummy-string as access_token: new Mastodon({access_token: 'dummy'})

ida avatar Apr 05 '19 16:04 ida

Ok, in this case I see this issue being done when this note gets added to the documentation (readme).

jaller94 avatar Apr 05 '19 17:04 jaller94

I will add publicOnly as a config parameter in the next version, which is cleaner than a dummy token.

vanita5 avatar Nov 20 '19 16:11 vanita5