Is there a way to get the response from API, whether a content is already published or not? | Community
Skip to main content
Level 2
July 13, 2015
Solved

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

  • July 13, 2015
  • 2 replies
  • 1613 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Neil_Enns_-_Ado

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

Neil

2 replies

Neil_Enns_-_Ado
Adobe Employee
Neil_Enns_-_AdoAdobe EmployeeAccepted solution
Adobe Employee
July 13, 2015

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

Neil

mikecyang
Adobe Employee
Adobe Employee
July 13, 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.