Adobe  I/O Adobe Target

Feeds

A feed is used to get and upload the products of customer and their corresponding attributes like name, value, margin, environment etc. See the parent page for common documentation that applies to all resources within the API.

List feeds

GET /recs/{client}/feeds
List all available feeds.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
offset (optional) Query Parameter — integer
limit (optional) Query Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/feeds?offset=1&limit=5

{
    "offset": 1,
    "limit": 5,
    "total": 8,
    "list": [
        {
            "uploadHistory": [
                {
                    "message": "0/0",
                    "date": "2014-08-07T16:34:01.000-04:00",
                    "status": "SUCCESS"
                },
                {
                    "message": "0/0",
                    "date": "2014-08-07T16:33:01.000-04:00",
                    "status": "SUCCESS"
                }
            ],
            "attributeMapping": {
                "author": "id"
            },
            "scheduleType": "daily",
            "environmentId": 8,
            "feedType": "google-atom-1",
            "name": "test feed 1",
            "id": 13,
            "connection": {
                "type": "url",
                "attributes": {
                    "URL": "https://recs/simulator/feeds/googlebase_feeds.jsp?randomEntityCount=142"
                }
            }
        }
    ]
}

Create a feed

POST /recs/{client}/feeds
Create a new feed as specified by the contents of the request and return the newly-created feed definition.
REQUEST BODY
feed (required) Body Parameter — ProductFeed
RESPONSES
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.

Sample code

$ cat feed.js

{
    "attributeMapping": {
      "brand": "name",
      "id": "id"
    },

    "scheduleType": "weekly",
    "scheduleTime": "09:20",
    "feedType": "google-atom-1",
    "environmentId": 9,
    "name": "FeedServiceImplCREATED",
    "connection": {
      "type": "url",
      "attributes": {
        "URL": "https://recs/simulator/feeds/googlebase_feeds.jsp?randomEntityCount=142"
      }
    }
}

curl -X POST -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/feeds -d@feed.js

<-- 201 OK
<-- Location https://{recs-host}/api/recs/demo/feeds/2

{
    "environmentId": 9,
    "attributeMapping": {
        "brand": "name",
        "id": "id"
    },
    "feedType": "google-atom-1",
    "scheduleType": "weekly",
    "scheduleTime": "09:20",
    "name": "FeedServiceImplCREATED",
    "id": 2,
    "connection": {
        "type": "url",
        "attributes": {
            "URL": "https://recs/simulator/feeds/googlebase_feeds.jsp?randomEntityCount=142"
        }
    }
}

Get a feed by id

GET /recs/{client}/feeds/{id}
Get the feed definition, specified by the provided id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/feeds/1

{
    "uploadHistory": [
        {
            "message": "0/0",
            "date": "2014-08-07T16:34:01.000-04:00",
            "status": "SUCCESS"
        },
        {
            "message": "0/0",
            "date": "2014-08-07T16:33:01.000-04:00",
            "status": "SUCCESS"
        }
    ],
    "attributeMapping": {
        "author": "id"
    },
    "scheduleType": "daily",
    "environmentId": 8,
    "feedType": "google-atom-1",
    "name": "test feed 1",
    "id": 13,
    "connection": {
        "type": "url",
        "attributes": {
            "URL": "https://recs/simulator/feeds/googlebase_feeds.jsp?randomEntityCount=142"
        }
    }
}

Update a feed by id

PUT /recs/{client}/feeds/{id}
Update a feed with the new rules specified by the request data.
REQUEST BODY
feed (required) Body Parameter — ProductFeed
RETURN TYPE
RESPONSES
200 OK
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

$ cat feed.js

{
    "attributeMapping": {
      "brand": "category",
      "id": "id"
    },
    "scheduleType": "daily",
    "feedType": "google-atom-1",
    "environmentId": 8,
    "name": "FeedServiceImplEDITED",
    "connection": {
      "type": "url",
      "attributes": {
        "URL": "https://recs/simulator/feeds/googlebase_feeds.jsp?randomEntityCount=142QQQ"
      }
    }
}

curl -X PUT -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/feeds/1 -d@feed.js

{
    "attributeMapping": {
      "brand": "category",
      "id": "id"
    },
    "scheduleType": "daily",
    "feedType": "google-atom-1",
    "environmentId": 8,
    "id": 1,
    "name": "FeedServiceImplEDITED",
    "connection": {
      "type": "url",
      "attributes": {
        "URL": "https://recs/simulator/feeds/googlebase_feeds.jsp?randomEntityCount=142QQQ"
      }
    }
}

Delete a feed

DELETE /recs/{client}/feeds/{id}
Delete the feed referenced by the specified id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
204 No Content
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

curl -X DELETE -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/feeds/1

{
    "attributeMapping": {
      "brand": "category",
      "id": "id"
    },
    "scheduleType": "daily",
    "feedType": "google-atom-1",
    "environmentId": 8,
    "id": 1,
    "name": "FeedServiceImplEDITED",
    "connection": {
      "type": "url",
      "attributes": {
        "URL": "https://recs/simulator/feeds/googlebase_feeds.jsp?randomEntityCount=142QQQ"
      }
    }
}

Field Description and Validation Rules

Field Path Description Validation
id Read only long value, generated by server side at the time of feed creation. Used to identify a feed in URL. Must not exist on POST. Optional on PUT but must be the same as the existing id if included.
name String. Must be unique, 250 characters or less and not empty.
environmentId Long. Use -1 for all environments. Must be the id of an existing environment. Cannot be 0 or missing.
feedType String. Possible values: google-atom-1, saint, csv Must be one of the valid types described in the description.
scheduleType String. Possible values: "daily", "weekly","biWeekly", "never" Must be one of the valid types described in the description.
scheduleTime Time to run the feed in format hh:mm Optional. Must be in the format hh:mm if specified.
connection Defines the connection attributes. Available for feedType google-atom-1 and csv  Must be one of the valid types described in the description.
connection->type Possible values "url" ,"ftp", "sc" Must be one of the valid types described in the description.
connection->attributes->URL String. URL for connection type.

connection->attributes->

   SERVER

   USERNAME

   PASSWORD

   FILENAME

   DIRECTORY

For ftp connection type. Represents the ftp servers settings.

connection->attributes->

    CLASSIFICATIONS

    REPORTSUITE

For Analytics saint connection type only. Classifications is the classification id. Reportsuite is the RSID string
attributeMapping Defined mapping of attributes for feeds. Available for type google-atom-1 & saint Must be defined for supported feed types. Mapping must contain an id. Duplicate attributes are not allowed in the mapping.