Is there a way to get the response from API, whether a content is already published or not?

Avatar

Avatar

digitalr3317510

Avatar

digitalr3317510

digitalr3317510

13-07-2015

Is there a way to get the response from adobe like the status of the content(article, banner)/ collection whether it exists, created successfully or not, published or not? We were checking the code and found that in each request they are calling to _request() function inside user.php, where they are calling to printCurlData() and where its printing the request url, request data and all. So we need the response code based on which we can create/update/publish the content from our end.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Neil_Enns_-_Ado

Employee

Avatar

Neil_Enns_-_Ado

Employee

Neil_Enns_-_Ado
Employee

13-07-2015

This same question was asked via our beta developer discussion group and was answered there.

Neil

Answers (1)

Answers (1)

Avatar

Avatar

mikecyang

Employee

Avatar

mikecyang

Employee

mikecyang
Employee

13-07-2015

Hi,

To check if the entity type (article/collection/banner) exists, please see getMetadata(). This will return a HTTP 404 Not Found if the entity does not exist, otherwise, a HTTP 200 OK if the entity was created already, with the entity’s metadata in the response body.


To check the publishing status of an entity or an ingestion status of an article, please see getStatus(). The response body will be empty if the entity have not been published at all. Otherwise, it’ll return something similar to the following:


Array

(

    [0] => Array

        (

            [aspect] => ingestion

            [subAspect] => Sealed

            [eventType] => success

            [eventDate] => 2015-07-06T16:45:13Z

            [lastSuccessDate] => 2015-07-06T16:45:13Z

            [numerator] => 6

            [denominator] => 6

            [message] => Sealed the contents of the article with the Producer Service

            [code] => 006

            [extraData] => 77da754b-c773-4413-b918-687c95f83637

        )

    [1] => Array

        (

            [aspect] => publishing

            [subAspect] =>

            [eventType] => success

            [eventDate] => 2015-07-06T20:12:18Z

            [lastSuccessDate] => 2015-07-06T20:12:18Z

            [numerator] =>

            [denominator] =>

            [message] =>

            [code] =>

            [extraData] =>

        )

)


You would then check the eventType type to see if the publishing or ingestion was successful (eventType === 'success'). Please note that the ingestion status will only show for articles. To track the progress of the article ingestion, you can use the numerator and denominator field.


To find more information on the different request and response data, please refer to the swagger documentation in the Download - Developer section of the prerelease forum.