Export Comments v2

Request an export of comments and check on the status of the request.

OpenWeb enables you to export comments. You can export comments based on a date range.

When initiating an export, be mindful of the following:

  • Each time an export is initiated, a new data set is generated.
  • The duration of the export process depends upon the size of the data set.
  • The Export API is not meant for incremental or repetitive queries.


Prerequisites

Item

Description

Export Token

Unique OpenWeb export token value

Use the following steps to locate the export token:

  • From your OpenWeb Admin Dashboard, click Settings.
  • Under Authentication Tokens, copy the Export value.

Export API Enablement

To use this API, request that it be enabled for your Spot ID from your OpenWeb PSM.



Create an export

Use the following steps to create an export:

  1. Make a POST /v2/export/comments call. The API returns the check status endpoint populated with the export request ID as the value of status_link.

    curl -L -X POST 'https://api-exporter.openweb.com/v2/export/comments' \
         -H 'apikey: EXPORT_TOKEN' \
         -H 'Content-Type: application/json' \
         -d '{"since": "2022-07-30T00:00:00", "to": "2022-07-30T23:59:00"}'
  2. Use the status_link value to make a GET /v2/export/comments/status call. The API returns secured URLs to download the export in a links array. If the export download is not ready, the API returns "status": "Processing".

    curl -L GET 'https://api-exporter.openweb.com/v2/export/comments/status?id=EXPORT_REQUEST_ID' \
         -H 'apikey: EXPORT_TOKEN' \
         -H 'Content-Type: application/json'
  3. Copy and paste the links into a web browser to download the .csv.zip file. Each .csv file will contain at most 100,000 comments.

    ⚠️

    The links secure links are only available for one week after being generated.



Export Field Reference

This section lists and defines each field returned in the export .csv file.

Field

Description

content

Raw content of the message

dislikes_count

Number of dislikes on the message

id

Unique identifier for the message

label_id

Identifier of the comment label. If no label is returned, value in this field is null.

likes_count

Number of likes on the message

message_status

Status of the message. Possible values:

  • approved
  • publish and moderate
  • rejected
  • require approval

post_id

Unique article identifier that is specific to the article page

reports_count

Number of times users reported the message

type

Type of message. Possible values: comment, reply

updated_at

Date of the most recent update to the message

user_display_name

Non-unique personal identifier used prominently throughout the platform

user_id

ID of the user

user_name

Unique personal identifier used to differentiate between different users

user_primarykey

Unique user ID generated by a Partner’s backend user management system

written_at

Creation date of the message