Skip to content

Overview

Display a public profile

Read the public profile of a RemiliaNET user with one request, with no application, approval, or token.

The user does not log in, so this request suits a public profile card on your site.

Prerequisites

You need a terminal with curl.

Steps

  1. Request the public profile of Remilia Jackson:

    curl --fail-with-body -sS https://www.remilia.net/api/v1/users/remilia_jackson
  2. Show user.displayName as the visible name.

  3. Show user.username as the handle.

  4. If the request returns 404, show a missing-profile state.

Result

The request returns HTTP 200 with the profile object at the root, without a data wrapper. This abbreviated example shows the fields that the steps read. Profile values can change.

{
  "user": {
    "username": "remilia_jackson",
    "displayName": "Remilia Jackson"
  }
}

An app-only token returns the same public profile. A user token adds details about the relationship between the logged-in user and the profile.

Profile card

To show the profile as the mini profile card of the live site, download the profile kit. For the markup, see Add a profile card.

Troubleshooting

A request from a browser can fail because of the origin policy of the API. For more information, see The browser blocks the request.

Next steps