1

I have added account linking to my project , and I tried both auth code and implicit flow and my account linking is successfully done , I tried account linking with google assistant app and it got linked successfully in both the flow implicit and auth code, but I can't find access token in request body and request header to my webhook call , I searched everywhere but access token is missing into the request , i am developing using new Actions Builder. According to doc the access token should be in user object but it's not there in my case.

Below is request

    {
  "requestJson": {
    "handler": {
      "name": "getleavecount"
    },
    "intent": {
      "name": "GET_LEAVES",
      "params": {},
      "query": "How many leave i have ?"
    },
    "scene": {
      "name": "GetInformation",
      "slotFillingStatus": "UNSPECIFIED",
      "slots": {}
    },
    "session": {
      "id": "ABwppHG-EoGM1K7M9mqBlNbdZQ_xnvkaQ2EvV6Lt49zeLta_qQJa2u9gSw3Tfh3PIDDVUSSPE7dVAqtZ3w8",
      "params": {
        "AccountLinkingSlot": "LINKED"
      },
      "typeOverrides": [],
      "languageCode": ""
    },
    "user": {
      "locale": "en-US",
      "params": {},
      "accountLinkingStatus": "LINKED",
      "verificationStatus": "VERIFIED",
      "packageEntitlements": [],
      "lastSeenTime": "2020-09-22T07:11:32Z"
    },
    "home": {
      "params": {}
    },
    "device": {
      "capabilities": [
        "SPEECH",
        "RICH_RESPONSE",
        "LONG_FORM_AUDIO"
      ]
    }
  }
}
大陸北方網友
  • 3,696
  • 3
  • 12
  • 37
  • `user.access_token` is documented as Google-actions-API-Version: 2 in https://developers.google.com/assistant/conversational/df-asdk/reference/webhook/rest/Shared.Types/AppRequest#User.FIELDS.access_token However the requests I'm getting seem to be Google-actions-API-Version: 3 as indicated in the HTTP headers and the format which doesn't include the accessToken matches https://developers.google.com/assistant/conversational/reference/rest/v1/TopLevel/fulfill Is this an oversight from Google devs when updating the API version? – ijmacd Oct 22 '20 at 08:04
  • It turns out the access_token was in the HTTP Authorization header as others had mentioned in other threads. I couldn't see it in PHP because apache had stripped it away. Adding `SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1` to `.htaccess` solved the problem. – ijmacd Jun 06 '22 at 11:25

0 Answers0