Gigya Job Openings

comments.moveComments REST

Skip to end of metadata
Go to start of metadata

 

 

This API initiates a job that moves comments from one stream to another. The destination stream must already exist. All the stream and category counters will be adjusted according to the moved comments. The method's callbackURL parameter can be used to retrieve the status of the job that moved the comments.

Request URL


Where <Data_Center> is:
  • us1.gigya.com - For the US data center.
  • eu1.gigya.com - For the European data center.
  • au1.gigya.com - For the Australian data center.
  • ru1.gigya.com - For the Russian data center.
  • cn1.gigya-api.cn - For the Chinese data center.

If you are not sure of your site's data center, see Finding Your Data Center.

Parameters

RequiredNameTypeDescription
srcCategory*string

The categoryID of the source stream (see the StreamInfo object). 

*You are required to pass either the jobID or the parameters srcCategory, srcStream and dstStream .

srcStream*string

The streamID of the source comments stream (see the Stream object). The comments in this stream are moved to the destination stream.

*You are required to pass either the jobID or the parameters srcCategory, srcStream and dstStream .

dstStream*string

The streamID of the destination comments stream (see the Stream object). The comments in the source stream are moved to this stream.

*You are required to pass either the jobID or the parameters srcCategory, srcStream and dstStream .

jobID*string

The identifier of the job performing the moveComments; the jobID will have been returned by a previous call to this method. When used, this parameter replaces srcCategory, srcStream and dstStream . Calling moveComments with a jobID returns additional information about the status of the move.

*You are required to pass either the jobID or the parameters srcCategory, srcStream and dstStream .

dstCategorystringThe categoryID of the destination stream (see the StreamInfo object). By default it is assumed to be the same as srcCategory .
filterobjectAn object made of tags: { tags: [ "tagString_01", "tagString_02" ] }
The list of tags according to which to filter the comments to be moved. The comments that are moved have all of the specified tags.
When a filter is used, it is applied only to the first comment in each thread. If the root of the thread meets the criteria, and is moved, then the entire thread will be moved with it.
callbackURLstring

A URL to which a response will be sent when moveComments has completed. The response will be sent as a GET request to the URL with an appended query string containing the jobID and context. The jobID can then be used to make an additional (information seeking) call to moveComments which will return the status and progress of the job: see the response fields below.

The query string will be in the following format: "jobID=<jobID>&context=<context>", where <jobID> is the jobID allocated to the task and <context> is the (optional) context string sent in the call to moveComments.

For example, if the callbackURL is " http://www.test.com ", the GET request is sent to " http://www.test.com?jobID=123&context={site:'mysite.com'} ".

contextobjectA customer-defined object that is passed back unchanged to the application as one of the fields in the response object.

Authorization Parameters

Each REST API request must contain identification and authorization parameters.

Some REST APIs may function without these authorization parameters, however, when that occurs, these calls are treated as client-side calls and all client-side rate limits will apply. In order to not reach client-side IP rate limits that may impact your implementation when using server-to-server REST calls, it is Recommended Best Practice to always sign the request or use a secret. A non-exhaustive list of REST APIs that this may apply to are as follows:

  • accounts.login
  • socialize.login
  • accounts.notifyLogin
  • socialize.notifyLogin
  • accounts.finalizeRegistration
  • accounts.linkAccounts

Please refer to the Authorization Parameters section for details. 

Sample Requests

 

Response Data

FieldTypeDescription
 
errorCode integer The result code of the operation. Code '0' indicates success, any other number indicates failure. For a complete list of error codes, see the Error Codes table.
errorMessage string A short textual description of an error, associated with the errorCode, for logging purposes. This field will appear in the response only in case of an error.
errorDetails string This field will appear in the response only in case of an error and will contain the exception info, if available.
fullEventName string The full name of the event that triggered the response. This is an internally used parameter that is not always returned and should not be relied upon by your implementation.
callId string Unique identifier of the transaction, for debugging purposes.
time string The time of the response represented in ISO 8601 format, i.e., yyyy-mm-dd-Thh:MM:ss.SSSZ or
statusCode integer The HTTP response code of the operation. Code '200' indicates success.
This property is deprecated and only returned for backward compatibility.
statusReason string A brief explanation of the status code.
This property is deprecated and only returned for backward compatibility.

 

jobIDstringThe identifier of the job. This is returned on a regular API call.
progressintegerA number between 0-100 indicating the progress of the job.
progressText*string

Text indicating the current state of the job.

status*string

The returned status may be:

  • Pending
  • Running
  • Succeeded
  • Failed
    • The returned statusReason to a "Failed" response is dependent upon the cause of the failure.
  • Rollback
    • In the unlikely event of a "Rollback", try resubmitting the job before contacting support.
  • Rollback-failed
    • "Rollback-failed" messages require a support call.
result*objectThe job's response object. It may be retrieved after the job is finished.
context*objectThe context is the JSON object passed to the moveComments call. If the context wasn't originally passed, it will not be returned in the response.

*Parameter returned if the call string included jobID.

A field that does not contain data will not appear in the response.

Response Examples

moveComments returns two different response structures.

Response to a regular call

This response is received when moveComments is sent with srcCategory, srcStream and dstStream.

{
  "statusCode": 200,
  "errorCode": 0,
  "statusReason": "OK",
  "callId": "2f8949b9f5ed4f46a4e14153f9dadd14",
  "time": "2015-03-22T11:42:25.943Z",
  "jobID": "2ea39e475703439d94a47c805e44c0f0",
  "progress": 0
}

Response when jobID is passed in the call

This response is received when moveComments is sent with jobID. In this case the response includes information about the job which actually moved the comments.

{
"statusCode": 200,
"errorCode": 0,
"statusReason": "OK",
"callId": "29a77ac73ba949a9b32ca519d38d9272",
"time": "2015-03-22T11:42:25.943Z",
"context": {
"dstStream": "20610333moved"
},
"jobID": "2ea39e475703439d94a47c805e44c0f0",
"status": "Succeeded",
"progress": 100,
"progressText": "done"
}