0

I've implemented account linking successfully but im not recving any accessTokens to my fulfillment end point.
The AccessToken field is empty in the json sent to my fulfilment end point.

Json Received to Fulfillment

 Array
 (
[user] => Array
    (
        [userId] => 1502895338751
        [locale] => en-US
    )

[conversation] => Array
    (
        [conversationId] => 1502895338751
        [type] => ACTIVE
        [conversationToken] => {"state":null,"data":{}}
    )

[inputs] => Array
    (
        [0] => Array
            (
                [intent] => actions.intent.TEXT
                [rawInputs] => Array
                    (
                        [0] => Array
                            (
                                [inputType] => KEYBOARD
                                [query] => talk to APPNAME
                            )

                    )

                [arguments] => Array
                    (
                        [0] => Array
                            (
                                [name] => text
                                [rawText] => talk to APPNAME
                                [textValue] => talk to APPNAME
                            )

                    )

            )

    )

[surface] => Array
    (
        [capabilities] => Array
            (
                [0] => Array
                    (
                        [name] => actions.capability.AUDIO_OUTPUT
                    )

                [1] => Array
                    (
                        [name] => actions.capability.SCREEN_OUTPUT
                    )

            )

    )

[device] => Array
    (
    )

[isInSandbox] => 1
)

Not quite sure what to do at this point, stuck here for over a week now. I contacted AOG Support, but they dont seem to undestand what im trying to say :/

enter image description here

My response from the fulfillment if the accessToken is not found

    header('Content-Type: application/json');
    $askToken = array (
  'conversationToken' => '{"state":null,"data":{}}',
  'expectUserResponse' => true,
  'expectedInputs' => 
  array (
    0 => 
    array (
      'inputPrompt' => 
      array (
        'initialPrompts' => 
        array (
          0 => 
          array (
            'textToSpeech' => 'PLACEHOLDER_FOR_SIGN_IN',

          ),
        ),
        'noInputPrompts' => 
        array (
        ),
      ),
      'possibleIntents' => 
      array (
        0 => 
        array (
          'intent' => 'actions.intent.SIGN_IN',
          'inputValueData' => 
         (object) array (
          ),
        ),
      ),
    ),
  ),
);
 echo json_encode($askToken);
 exit();
Elo97234c
  • 163
  • 1
  • 4
  • 15
  • How are you requesting account linking (show code or screen shots) and is this working? Can you show a screen shot of the Account Linking section of the Actions console? – Prisoner Aug 16 '17 at 15:28
  • Yes, my OAUTH2.0 server works perfectly (Tested with Google OAUTH Playground). Im just not getting any Sign in options for the user when testing on the simulator. – Elo97234c Aug 16 '17 at 15:45
  • Are you using API.AI or gactions? How are you triggering the sign-in? – Prisoner Aug 16 '17 at 16:19
  • im using gactions, as mentioned in this article https://developers.google.com/actions/identity/account-linking if you go to 'Account linking at invocation' time' u'll see a option saying 'Sign in Required for the welcome intent' but the thing is im not using API.AI im using gactions. There isnt any options to set it for gactions is there? – Elo97234c Aug 16 '17 at 17:14

1 Answers1

1

Since you're not using API.AI, you need to initiate the request for account linking during fulfillment of one of your intents - probably your welcome intent. The JSON you need to send back in this case looks something like


{
  "conversationToken": "{\"state\":null,\"data\":{}}",
  "expectUserResponse": true,
  "expectedInputs": [
    {
      "inputPrompt": {
        "initialPrompts": [
          {
            "textToSpeech": "PLACEHOLDER_FOR_SIGN_IN"
          }
        ],
        "noInputPrompts": []
      },
      "possibleIntents": [
        {
          "intent": "actions.intent.SIGN_IN",
          "inputValueData": {}
        }
      ]
    }
  ]
}
Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • I did the following as you said, now all the assistant says is "Sorry, i didnt get any response", "Sorry, I did not understand" – Elo97234c Aug 17 '17 at 18:06
  • Please update your original question with any additional information you have - logs and the JSON you're sending and receiving after sending the sign-in request. – Prisoner Aug 17 '17 at 20:46