add

Request

Request structure in JSON format:

{
  "method": "add",
  "params": { /* params */
    "Feeds": [{ /* FeedAddItem */
      "Name": (string), /* required */
      "BusinessType": ( "RETAIL" | "HOTELS" | "REALTY" | "AUTOMOBILES" | "FLIGHTS" | "OTHER" ), /* required */
      "SourceType": ( "URL" | "FILE" ), /* required */
      "UrlFeed": { /* UrlFeedAdd */
        "Url": (string), /* required */
        "RemoveUtmTags": ( "YES" | "NO" ),
        "Login": (string),
        "Password": (string),
      },
      "FileFeed": { /* FileFeedAdd */
        "Data": (base64Binary), /* required*/ 
        "Filename": (string) /* required */
      }
    }, ... ] /* required */
  }
}
Parameter Type Description Required
Params structure (for JSON) / AddRequest structure (for SOAP)
Feeds array of FeedAddItem Feeds to add (maximum of 50). Yes
FeedAddItem structure
Name string The name of the feed. Maximum of 255 characters. Yes
BusinessType BusinessTypeEnum Type of business. Defines the available feed formats. See Business type for feed. Yes
SourceType SourceTypeEnum Type of data source:
  • URL — The feed is available at hte URL.
  • FILE — The feed is passed in the request.
Yes
UrlFeed UrlFeedAdd Parameters of the feed that is available at the URL. Either UrlFeed or FileFeed
FileFeed FileFeedAdd Parameters of the feed that is passed in the request.
UrlFeed structure
Url string Feed URL. Maximum of 1024 characters. It must include the protocol and domain name. Yes
RemoveUtmTags YesNoEnum Automatically delete UTM tags from links in the feed. The default value is NO. No
Login string Login for accessing the feed (if required). Maximum of 255 characters. No
Password string Password for accessing the feed (if required). Maximum of 255 characters. No
FileFeedAdd structure
Data base64Binary

A base64-encoded feed to upload. The feed size is limited by the total request size — maximum of 50 MB.

Note.

When using the SOAP library, place the feed file directly in this field, and the library automatically encodes it as base64 during transmission.

When using JSON format, first encode the binary data in base64, then pass it as a string.

Yes
Filename string Name of the feed file. Maximum of 255 characters. Yes

Response

Response structure in JSON format:

{
  "result": { /* result */
    "AddResults": [{  /* ActionResult */
      "Id": (long),
      "Warnings": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ]
    }, ... ]
  }
}
Parameter Type Description
Result structure (for JSON) / AddResponse structure (for SOAP)
AddResults array of ActionResult Results of adding feeds.
ActionResult structure
Id long

The feed ID. Returned if there aren't any errors. See the section Operations on object arrays.

Warnings array of ExceptionNotification

Warnings that occurred during the operation.

Errors array of ExceptionNotification

Errors that occurred during the operation.

Example

{
  "method": "add",
  "params": { 
    "Feeds": [{
      "Name": "MyFeed",
      "BusinessType": "RETAIL",
      "SourceType": "FILE",
      "FileFeed": {
        "Data": "iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAA..." 
        "Filename": "myfeed.xml"
      }
    }]
  }
}