Skip to content

Export url

Clark Winkelmann edited this page Oct 23, 2019 · 4 revisions

Note: if you are still using the Flagrow version (<0.4.0), replace /fof/ with /flagrow/ in the API urls.

For each policy you create, you can export all the data by visiting <your forum url>/api/fof/terms/policies/<policy id>/export.<format>.

The complete url can be copied from the "Export url" field when editing a policy.

Format can be json or csv.

The following fields are available in the export:

  • id: User ID
  • email: User user email
  • username: Current user username
  • display_name: Current user display name, if that feature was enabled by an extension
  • joined_at: Time the user was registered (use join_time on Flarum beta 7)
  • accepted_at: Last time the user accepted this policy

You can use an optional include parameter to choose which values are returned with the export. By default only email, joined_at and accepted_at are returned. If include is sent, only values included in it will be returned.

Use commas to separate the fields in the include parameter. Example: /api/fof/terms/policies/1/export.json?include=email,username,accepted_at.

If you don't want the header line with the CSV export, you can add a no-csv-header parameter to the query. Example: /api/fof/terms/policies/1/export.csv?no-csv-headers=1

Permissions

The access to that URL is restricted by a Flarum permission. By default only admins have access to that feature. You can change who has access to it by going to the Permissions area and changing the value for "Export all policies data".

Anybody with the permission will be able to get the list of all users on the forum along with their emails and policy accept date. Leave that permission to admins only unless you know what you're doing !

Clone this wiki locally