POST /taxonomy - Upload New Taxonomy

Use this function to create or refresh taxonomy for the data that you share with Yahoo. There can be only one version of the taxonomy active at any time. Do not use this API to append to the active taxonomy, as calling this API will replace contents of the current taxonomy with contents of this request (if/when successfully processed). To add a new campaign/segment/attribute/node, please use the PUT /taxonomy API described in the next section.

The API will usually return a 202 Accepted response with updated metadata in its response. An API caller can fetch metadata’s “self” link to check for status updates.

Example - v1 Request

POST /v1/taxonomy HTTP/1.1
Host: datax.yahooapis.com
Content-Type: multipart/form-data;boundary=xyz

--xyz
Content-Disposition: form-data; name="metadata"
Content-Type: application/json;charset=UTF-8

{ "description" : "YaRetail Pilot Taxonomy v1" }

--xyz
Content-Disposition: form-data; name="data" Content-Type: application/json;charset=UTF-8

[
        {
                "id" : "YR1194",
                "name" : "Baby Products",
                "type" : "SEGMENT"
        }
]
--xyz-

Example - Successful Response

HTTP/1.1 202 Accepted
Content-Type: application/json;charset=UTF-8
Date: Tue, 14 May 2013 17:47:30 GMT

{
        "resourceType" : "datax-taxonomy",
        "resourceId" : "130815T013759Z662599033", "createTime" : "2013-14-05T17:47:32Z",
        "description" : "YaRetail Pilot Taxonomy v1",
        "links" : [{
                "rel"   : "self",
                "href" : "https://datax.yahooapis.com/v1/link/s/ozQ8sfj7EJV-"
        },{
                "rel"   : "describes",
                "href" : "https://datax.yahooapis.com/v1/link/rw5fasr4akhaQ-"
        }],
        "status" : {
                "state" : "PROCESSING",
                "lastUpdateTime" : "2013-14-05T17:47:32Z"
        }
}

Example - Failed Response - Invalid Taxonomy JSON

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8 Date: Tue, 14 May 2013 17:47:30 GMT
{
        "resourceType" : "datax-taxonomy", "resourceId"
        : "130715T013759Z212573056", "createTime" :
        "2013-14-05T17:47:32Z",
        "description" : "YaRetail Pilot Taxonomy v1", "links" : [{
                "rel"   : "self",
                "href" : "https://datax.yahooapis.com/v1/link/s/ozQ8sfE9ffoJJV-"
        },{
                "rel"   : "describes",
                "href" : "https://datax.yahooapis.com/v1/link/rw5fasr4ajrtkhaQ-"
        }],
        "status" : {
                "state" : "ERROR",
                "lastUpdateTime" : "2013-14-05T17:47:31Z",
                "errors" : [{
                        "code" : "DATAX-1001",
                        "message" : "Input Taxonomy failed schema validation", "log" :
                        null
                }]
        }
    }
}