Export Comments v2

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

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

When initiating a comment export, be mindful of the following:

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

📘

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



Requirement



Export comments

Use the following steps to export Conversation comments:

  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"}'

  1. 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'

  1. Copy and paste the links into a web browser to download the .csv.zip file. Each .csv file will contain less than 10,000 messages.

    ⚠️

    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
  • published 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



API Reference

Request comment export

/v2/export/comments
Initiates a comment export

Request

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"}'

Header Parameter
Parameter Description
EXPORT_TOKEN string Unique OpenWeb export token

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


Body Parameters
Parameter Description
since* string Start date of the export date range in YYYY-MM-DDTHH:MM:SS ISO 8601 format

Example: 2018-12-01T00:00:00
to string End date of the export date range in YYYY-MM-DDTHH:MM:SS ISO 8601 format

Example: 2018-12-02T00:00:00

If not set, the value of the parameter is set to the current date and time.


Response

{
    "status-link": "STATUS_LINK",
    "status": "pending",
    "request_id": "REQUEST_ID"
}

Response Parameters
Parameter Description
request_id object Unique ID of the export request
status string State of the export request

Possible values:
  • pending
status-link string Check status endpoint


Check comment export status

/v2/export/comments/status
Retrieves the status of the comment export

Request

curl -L -X GET 'https://api-exporter.openweb.com/v2/export/comments/status?id=EXPORT_REQUEST_ID' \
     -H 'apikey: EXPORT_TOKEN' \
     -H 'Content-Type: application/json' \

Header Parameters
Parameter Description
apikey string Unique OpenWeb export token

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


Query Parameters
Parameter Description
id* string Unique ID of a comment export request

This value is returned in the API response to a POST /v2/export/comments call.


Response

{
    "links": ["....", "....", ...],
    "status": "done",
    "status-link": "https://api.openweb.com/v2/export/comments/status?id=EXPORT_REQUEST_ID"
}

Response Parameters
Parameter Description
links array Secured URLs to an export download, present only when "status": "done"

Each export download contains less than 10,000 messages. Links are valid for one hour. After one hour, a new request must be made.
status string State of the export request

Possible values:
  • aborted
  • done
  • failed
  • in_progress
  • pending
status-link string Check status endpoint


Abort comment export

/v2/export/comments/abort
Cancels a comment export

Request

curl -L -X GET 'https://api-exporter.openweb.com/v2/export/comments/abort' \
     -H 'apikey: EXPORT_TOKEN' \
     -H 'Content-Type: application/json'

Header Parameter
Parameter Description
EXPORT_TOKEN string Unique OpenWeb export token

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