Skip to main content

Best Practices

Best Practices

Service Account

A common approach when using Fider API is to sign in with a generic email address (like admin@yourcompany.com), then have an existing Administrator promote this new user to Administrator on the Members page (/admin/users). This allows you to use a common user account on all API operations, without having to use a personal user account.

How to properly use impersonation

We usually recommend the usage of impersonation in combination with the Create User API. This API will retrieve or create a user and return its User ID, which can then be used to impersonate that user.

As an example, imagine that you have a Mobile App that lists all your Fider posts and you want to let the user vote on it via your App. The first step is to call Create User with the name, email and an optional (although recommended) reference ID. The API will then return a user ID. It might be a new user ID or an existing one, it doesn't matter. Call the Vote on a Post API with the X-Fider-UserID header to execute this action under that user account.