New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds site metadata access to the API #654

Merged
merged 2 commits into from Mar 15, 2017

Conversation

Projects
None yet
2 participants
@marrus-sh
Contributor

marrus-sh commented Feb 27, 2017

Right now, there is afaik no way for a frontend to know certain (potentially important) features of a Mastodon instance, such as its title or the maximum number of characters it allows in a post. This fixes this problem by returning a site metadata object from GET /api/v1/site. This object takes the following form:

{
    "title": "Site title",
    "max_chars": 500,
    "links": {}
}

…where links is an object containing various helpful (named) site links, such as /about/more and /terms.

Other considerations

  • I didn't see a point in authenticating the user before displaying this information so right now it's open to the public
  • There are other properties that it might be useful to have; for example "url" might provide the canonical URL for the site, and "api_url" might be the recommended API access point (eg, "/api/v1"). I kept it minimal though.
  • This might also be a good place to put the location for accessing the WebSocket stream.

@Gargron Gargron merged commit e245115 into tootsuite:master Mar 15, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

abcang added a commit to pixiv/mastodon that referenced this pull request Nov 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment