Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

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

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Employee

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

Neil

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

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

Neil

Avatar

Employee

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.