Skip to content

Indexing API is not Returning result for latestupdate #2628

Open
@chiragvels

Description

@chiragvels

Environment details

  • OS: Linux
  • PHP version: 8.1
  • Package name and version: v2.17.0

Steps to reproduce

  1. https://indexing.googleapis.com/batch use with Google_Service_Indexing
  2. Google_Service_Indexing_UrlNotification to get response

Code example

$response_meta = $result->getUrlNotificationMetadata();

if ($response_meta) {
    $response_latest_update = $response_meta->getLatestUpdate();
    
    if ($response_latest_update) {
        $response_url = $response_latest_update->getUrl();
        $response_type = $response_latest_update->getType();
        $response_notify_type = $response_latest_update->getNotifyTime();
        
        echo 'URL: ' . $response_url . PHP_EOL;
        echo 'Type: ' . $response_type . PHP_EOL;
        echo 'Notify Time: ' . $response_notify_type . PHP_EOL;
    } else {
        echo 'No latest update found for this URL.' . PHP_EOL;
    }
} else {
    echo 'No metadata found for this URL.' . PHP_EOL;
}

I am not getting $response_latest_update response.

Response is only this:


Google\Service\Indexing\UrlNotificationMetadata Object
(
    [latestRemove] => 
    [latestRemoveType:protected] => Google\Service\Indexing\UrlNotification
    [latestRemoveDataType:protected] => 
    [latestUpdate] => 
    [latestUpdateType:protected] => Google\Service\Indexing\UrlNotification
    [latestUpdateDataType:protected] => 
    [url] => https://example.com/blog
    [internal_gapi_mappings:protected] => Array
        (
        )

    [modelData:protected] => Array
        (
        )

    [processed:protected] => Array
        (
        )

)

Reference:

https://developers.google.com/search/apis/indexing-api/v3/reference/indexing/rest/v3/UrlNotificationMetadata

https://developers.google.com/search/apis/indexing-api/v3/reference/indexing/rest/v3/urlNotifications#UrlNotification

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions