Export OpenWeb comments
Use OpenWeb's API to export your Conversation comments by article ID or date range
Exporting comments
OpenWeb enables you to export Conversation comments. You can export comments based on a specific article ID or a specific date range.
Export comments by article ID
Allows the export of some or all of the comments of a specific article
GET https://open-api.spot.im/v1/spot-conversation-events/text-only?token={EXPORT_TOKEN}&spot_id={SPOT_ID}&post_id={POST_ID}&etag=0&count={MESSAGES_COUNT}
Query param | Description |
---|---|
post_id* string | Article identifier that is specific to the article page This value is defined when the Conversation is embedded on a page. |
spot_id* string | Unique OpenWeb identifier for your property 1. Log into your Admin Dashboard. 2. Copy your Spot ID from the URL: https://admin.spot.im/spot/{SPOT_ID}/... |
token* string | Unique OpenWeb export token 1. From your OpenWeb Admin Dashboard, click Settings. 2. In the Authentication Tokens, copy the export token. |
count number | Number of messages to export If this is set to 10 , the first 10 messages are exported. When count is not included in the API call, all messages are exported. |
The GET
call returns a response that contains the messages for the specified article ID (post_id
). The number of messages returned is limited by the count
defined in the GET
call.
{
"spot_id": "sp_1234abcd",
"conversation_id": "sp_1234abcd_postID",
"post_id": "postID",
"from_etag": 0,
"new_etag": 6,
"events": [
{
"type": "comment-created",
"message": {
"id": "sp_1234abcd_postID_messageID",
"content": "This is a comment",
"written_at": "2020-05-06 12:44:00 +0000",
"offset": 0,
"user_id": "u_userid"
}
},
{
"type": "reply-created",
"message": {
"id": "sp_1234abcd_postID_messageID_replyID",
"content": "This is a reply",
"written_at": "2020-04-09 16:10:53 +0000",
"offset": 0,
"nick_name": ""
}
}
],
"users": {
"u_userid": {
"user_name": "{USER_NAME}",
"display_name": "{DISPLAY_NAME}"
}
}
}
Export comments by date range
Allows the export of comments based upon a specified date range
To successfully export comments using this API call, you must make a POST
call followed by a GET
call.
Use the following steps to export comments with this route:
- Make a
POST https://open-api.spot.im/v1/comments/export
. In the body of the request, include your OpenWeb Spot ID, export token, and date range.
POST /v1/comments/export HTTP/1.1
Host: open-api.spot.im
Content-Type: application/json
{
"spot_id": "sp_UcvuOt10",
"token": "03200408ojyT1W",
"since": "2018-12-01T00:00:0",
"to":
}
Parameter | Description |
---|---|
since* string | Start date of the export date range in YYYY-MM-DDTHH:MM:S ISO 8601 format, for example: 2018-12-01T00:00:0 |
spot_id* string | Unique OpenWeb identifier for your property 1. Log into your Admin Dashboard. 2. Copy your Spot ID from the URL: https://admin.spot.im/spot/{SPOT_ID}/... |
token* string | Unique OpenWeb export token 1. From your OpenWeb Admin Dashboard, click Settings. 2. In the Authentication Tokens, copy the export token. |
to string | End date of the export date range in YYYY-MM-DDTHH:MM:S ISO 8601 format, for example: 2018-12-02T00:00:0 If not set, the value of this parameter is set to the current date and time. |
The POST
call returns an export_id
.
{
"export_id": "5f04a976-049e-41e4-aeea-03df2ddc9a48"
}
- Make a
GET https://open-api.spot.im/v1/comments/{EXPORT_ID}/status?token={EXPORT_TOKEN}&spot_id={SPOT_ID}
. Be sure to replace the following placeholders:
•{EXPORT_ID}
: Replace with theexport_id
returned in thePOST
API response.
•{EXPORT_TOKEN}
: Replace with your OpenWeb export token.
•{SPOT_ID}
: Replace with your Spot ID.
The API call returns one of the following responses.
{
"status": "Processing"
}
{
"status": "Done",
"export_urls": [<SECURED-URLS>],
"count": 5
}
Parameter | Description |
---|---|
count number | Total number of records within the zipped .csv file export |
export_urls string | Secured URL to the export download |
status string | Status of the export |
- Copy and paste the
export_urls
into a web browser to download the .csv.zip file.
IMPORTANT
The
export_urls
link will only be available for one week.
Updated about 1 year ago