Export Comments v4 🆕

Request an export of comments, users, and ranks by Conversation ID or date range.

OpenWeb enables you to export comments with their authors and ranks. You can export comments based on a Conversation ID or 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.
  • Export by date range is limited to a range of 30 days.


Prerequisite

ItemDescription
JWT TokenJWT token to be used for OpenWeb API


Create an export

Use the following steps to create an export:

  1. Make a POST /v4/export call with a JSON body that defines the date range or Conversation ID. The API returns the check status endpoint populated with the export request ID as the value of status_link.

    ⚠️

    Be mindful of the following when creating an export:

    • Only one export can be run at a time per spot.
    • When defining the date range, the duration between the from and until values must be ≤ 1 month (730 hours).
    curl -L -X POST 'https://api-exporter.openweb.com/v4/export' \
         -H 'Authorization: Bearer JWT_TOKEN' \
         -H 'x-spot-id: "SPOT_ID"' \
         -H 'Content-Type: application/json' \
         -d '{"from": "2022-07-30T00:00:00Z","until": "2022-07-30T23:59:00Z","max_records_in_file": 10000}'
    
    curl -L -X POST 'https://api-exporter.openweb.com/v4/export' \
         -H 'Authorization: Bearer JWT_TOKEN' \
         -H 'x-spot-id: "SPOT_ID"' \
         -H 'Content-Type: application/json' \
         -d '{"delimiter": ",","conversation_id": "CONVERSATION_ID","max_records_in_file": 10000}'
    

  2. Use the status_link value to make a GET /v4/export/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/v4/export/status?id=EXPORT_REQUEST_ID' \
         -H 'Authorization: Bearer JWT_TOKEN' \
         -H 'x-spot-id: "SPOT_ID"' \
         -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.



💡

You can also abort an export request or list all finished exports .



Export Field Reference

This section lists and defines each field returned in the exported data.

Comments

Field Description
MessageID Unique ID of the message
UserID ID of the user
Username Username of the user
SpotID ID of the spot
PostID ID of the post
MessageStatus Status of the message

Possible Values:
  • approved
  • publish and moderate
  • rejected
  • require approval
Content Raw content of the message
WrittenAt Creation timestamp
UpdatedAt Update timestamp
Tags Violation tags
Type Type of the message

Possible Values:
  • comment
  • reply
Edited Identifies was the message edited
ParentID ID of the direct message parent
ParentCommentID ID of the root message
PreviousState Identifies previous state
Likes Number of likes on the message
Dislikes Number of dislikes on the message
ArticleURL URL of the article in which the comment is posted
ReportsCount Number of times users reported the message
AutomatedState Identifies automated state
ManuallyResolved Identifies was the message manually resolved
Published Identifies was the message published
IP IP of the comment's author

Users

Field Description
UserID ID of the user
DisplayName Display name of the user
Username Username of the user
Email Email of the user
ImageID Image ID of the user

Ranks

Field Description
UserID ID of the user
CreatedAt Creation timestamp
MessageID Unique ID of the message
PostID ID of the post
Operation Identifies the operation type

Possible values:
  • 0: dislike
  • 1: like