Reports
As the name suggests, reports are a core part of our platform — the very reason the platform exists is so you can generate and manage detailed analytical reports. On this page, we'll dive into the different report endpoints you can use to manage reports programmatically. We'll look at how to query, create, update, and delete reports.
The report model
The report model contains all the information about your reports, such as their name, type, and format. It also contains references to the associated user, team, and segment, along with details about when the report was created and last updated on the platform.
Properties
- Name
id
- Type
- integer
- Description
Unique identifier for the report.
- Name
user_id
- Type
- integer
- Description
The unique identifier linked to the User who create the report.
- Name
team_id
- Type
- integer
- Description
The unique identifier linked to the Team that own the report.
- Name
segment_id
- Type
- integer
- Description
The unique identifier linked to the Segment FQL that own the report.
- Name
name
- Type
- string
- Description
The name of the report.
- Name
type
- Type
- string
- Description
The type of the report (master, private or public)
- Name
status
- Type
- string
- Description
The status of the report (draft or published)
- Name
fql
- Type
- string
- Description
The current FQL globally applied to the report.
- Name
color
- Type
- string
- Description
The color palette applied to the report.
- Name
created_at
- Type
- timestamp
- Description
Timestamp of when the report was created.
- Name
updated_at
- Type
- timestamp
- Description
Timestamp of when the report was last updated on the platform.
List all reports
This endpoint allows you to retrieve a paginated list of all your reports. By default, a maximum of ten reports are shown per page.
Optional attributes
- Name
page
- Type
- integer
- Description
Number of the page to display.
- Name
filter
- Type
- integer
- Description
Narrow your search by using filter from JSON:API norms
Allowed filters:name
,user_id
,team_id
- Name
sort
- Type
- integer
- Description
Sort the elements in a specific order by using JSON:API norms
Allowed sorts:name
,created_at
Request
curl -G https://api.bx.feedier.com/v3/reports \
-H "Authorization: Bearer {token}"
Response
{
"data": [
{
"id": 250,
"user_id": null,
"team_id": 1,
"segment_id": null,
"name": "Unnamed report",
"type": "public",
"status": "published",
"fql": "[{\"TimePeriod\": {\"$eq\": \"date_last_month\", \"$type\": \"and\"}}]",
"color": null,
"created_at": "2024-04-25T11:17:17.000000Z",
"updated_at": "2024-04-25T11:17:20.000000Z"
},
{
"id": 251,
// ...
},
],
"links": {
"first": "https://api.bx.feedier.com/v3/reports?page=1",
"last": "https://api.bx.feedier.com/v3/reports?page=2",
"prev": null,
"next": "https://api.bx.feedier.com/v3/reports?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 2,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
// ...
],
"path": "https://api.bx.feedier.com/v3/reports",
"per_page": 10,
"to": 10,
"total": 15
}
}
Create a report
This endpoint allows you to create a new report into the Dashboard.
Optional attributes
- Name
user_id
- Type
- integer
- Description
The unique identifier linked to the User who create the report.
- Name
team_id
- Type
- integer
- Description
The unique identifier linked to the Team who the report will be attached. By default, it will be attached to the main team of the organization.
- Name
segment_id
- Type
- integer
- Description
The unique identifier linked to the Segment FQL.
- Name
master_id
- Type
- integer
- Description
The unique identifier of a Master Report that will be cloned as a template.
- Name
name
- Type
- string
- Description
The name of the report.
- Name
fql
- Type
- json
- Description
The Global FQL to apply in all the components.
- Name
type
- Type
- string
- Description
The type of the report. Can be: master, private or public
- Name
status
- Type
- string
- Description
The status of the report. Can be: draft or published
- Name
format
- Type
- string
- Description
The format of the report. Can be: blank or prefilled.
By creating a prefilled report, a bunch of components based on your surveys will automatically be created.
Request
curl https://api.bx.feedier.com/v3/reports \
-H "Authorization: Bearer {token}" \
-d name="Weekly Report" \
-d format="prefilled"
Response
{
"id": 250,
"user_id": null,
"team_id": 1,
"segment_id": null,
"name": "Unnamed report",
"type": "public",
"status": "published",
"fql": "[{\"TimePeriod\": {\"$eq\": \"date_last_month\", \"$type\": \"and\"}}]",
"color": null,
"created_at": "2024-04-25T11:17:17.000000Z",
"updated_at": "2024-04-25T11:17:20.000000Z"
}
Retrieve a report
This endpoint allows you to retrieve a report by providing their unique identifier. Refer to the list at the top of this page to see which properties are included with contact objects.
Request
curl https://api.bx.feedier.com/v3/reports/250 \
-H "Authorization: Bearer {token}"
Response
{
"id": 250,
"user_id": null,
"team_id": 1,
"segment_id": null,
"name": "Unnamed report",
"type": "public",
"status": "published",
"fql": "[{\"TimePeriod\": {\"$eq\": \"date_last_month\", \"$type\": \"and\"}}]",
"color": null,
"created_at": "2024-04-25T11:17:17.000000Z",
"updated_at": "2024-04-25T11:17:20.000000Z"
}
Update a report
This endpoint allows you to perform an update on a report.
Optional attributes
- Name
user_id
- Type
- integer
- Description
The unique identifier linked to the User who create the report.
- Name
segment_id
- Type
- integer
- Description
The unique identifier linked to the Segment FQL that own the report.
- Name
name
- Type
- string
- Description
The name of the report.
- Name
fql
- Type
- json
- Description
The Global FQL to apply in all the components.
- Name
type
- Type
- string
- Description
The type of the report (master, private or public)
Request
curl -X PUT https://api.bx.feedier.com/v3/reports/250 \
-H "Authorization: Bearer {token}" \
-d name="Private Weekly Report" \
-d type="private"
Response
{
"id": 250,
"user_id": null,
"team_id": 1,
"segment_id": null,
"name": "Unnamed report",
"type": "public",
"status": "published",
"fql": "[{\"TimePeriod\": {\"$eq\": \"date_last_month\", \"$type\": \"and\"}}]",
"color": null,
"created_at": "2024-04-25T11:17:17.000000Z",
"updated_at": "2024-04-25T11:17:20.000000Z"
}
Delete a report
This endpoint allows you to delete reports from your report list.
Request
curl -X DELETE https://api.bx.feedier.com/v3/reports/250 \
-H "Authorization: Bearer {token}"
Generate a shareable link
This endpoint allows you to generate a shareable link for a given report.
Request
curl -X POST https://api.bx.feedier.com/v3/reports/250/share \
-H "Authorization: Bearer {token}"
Response
{
"id": 1176,
"token": "qZZTofDvCMK1Ps5A2L8PlkKPDjCVzj",
"public_link": "https://api.bx.feedier.com/report/250/shareable?token=qZZTofDvCMK1Ps5A2L8PlkKPDjCVzj",
"created_at": "2024-07-28T13:20:10.000000Z",
"updated_at": "2024-07-28T13:20:10.000000Z"
}