Google Indexing API - 403 'Forbidden Response'

前端 未结 4 774
自闭症患者
自闭症患者 2021-01-05 13:27

I am making a call to the google indexing API for job postings:

private $client;
private $httpClient;

public function initClient($kernel)
{
    $this->cl         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-05 13:56

    "Make sure that you have added the service account as an Owner in Google Search Console"

    Yep. Use the following code snippet to examine the body response for a more detailed error msg.

        var body = result.Content.ReadAsStringAsync().Result;
    

    if the error msg looks like the following, then this is the same problem.

    "message": "Permission denied. Failed to verify the URL ownership."

    Worth noting: The new version of the search console is lacking. At the bottom of the left-hand menu is a "go to the old version" link. Click this and then select "verification details" from the gear menu (upper right). Next, click on the link that says "verification details" (seriously!). Here, you will finally see a list of verified owners at the bottom of the page. You can add a new owner here, using the email address of your service account (addr can also be found in your json key file).

提交回复
热议问题