Question

Access to authentication test output data ?

  • 30 June 2020
  • 6 replies
  • 1555 views

Hi,

I’m currently integrating my app on Zapier and I wanted to know if there is any way to have access to the authentication test output data into a trigger ?

Concretely, my authentication test reques returns the current user ID like so :

{
"userId": "Q00ZZXuJmQakonYggNMkLGDs0y93"
}

I need to have access to this value in my triggers. I tried calling `bundle.authData.userId` but it’s incorrect.


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

6 replies

Userlevel 7
Badge +10

@baptisteArnaud have you tried bundle.inputData.userId or putting a dollar sign in front when using the tick marks 

`$bundle.inputData.userId`

I forget when to use the dollar sign and when not to, but I do know the tickmarks allow for the dollarsign to indicate something to process. 

 

Also, bundle.authData is the information the user might enter with their username/password whereas bundle.inputData is anything the authentication process would respond with on the test. 

Bundle Explanations in the docs.

@baptisteArnaud have you tried bundle.inputData.userId or putting a dollar sign in front when using the tick marks 

     `$bundle.inputData.userId`

I forget when to use the dollar sign and when not to, but I do know the tickmarks allow for the dollarsign to indicate something to process. 

 

Also, bundle.authData is the information the user might enter with their username/password whereas bundle.inputData is anything the authentication process would respond with on the test. 

Bundle Explanations in the docs.

Thanks for taking the time to help me. :)


The doc says :

In authentication fields and connection labels, inputData contains the output fields returned from the test API call, typically used to add a label to new integration connections.

In Trigger and Action steps, inputData contains the data from input forms that users enter themselves which Zapier passes to the app with that Trigger or Action’s API call, with {{curlies}} mapped fields from previous Zap steps rendered with their raw data.

 

Which means that output fields returned from the test API call aren’t transmitted in Triggers and Actions? Indeed when I inspect bundle on my trigger test call it doesn’t show any data from the authentication besides authData :

{
"authData": {
"email": ":censored:27:79e79c48d1:",
"password": ":censored:8:2fb06236a6:",
"idToken": ":censored:988:b8da274faa:"
},
"inputData": {},
"inputDataRaw": {},


}

Is there a way to get access to inputData values returned by the auth test call in triggers?

Userlevel 7
Badge +10

Is there a way to get access to inputData values returned by the auth test call in triggers?

Ug, it seems not.

 

However, if you used userId as a key for a computed field (see documentation) in theory it should pull that into the authData bundle and then you can use that in your triggers etc.

{{bundle.authData.userId}}

Computed Fields, on the other hand, store values obtained from an integration’s API test call, so they can be referenced in your integration’s subsequent API calls. Use the same field key as the name your API uses for this field. Zapier then will match the API test call’s output to your computed field, make sure the response includes that field, and will show an error if that field is not included. You can then reference the field in any subsequent API call from your integration from the input bundle 

Userlevel 1

Hello, 

@baptisteArnaud Have you managed to solve this?

I faced kinda the same issue. I need to store customer_uuid from authentication response and use it to create rest hooks from the triggers. I have a custom authentication with api_token.

@PaulKortman it seems that computed fields cannot help in case of custom authentication as documentations says:

Note: Only OAuth and Session Auth support computed fields.

Userlevel 7
Badge +10

@Aleksei you could trick it into Session Auth, I’ve used Session Auth for api_token before it’s a bit cumbersome, but if you need to use computed fields you can switch over to session auth. (just imagine the session never expiring and store the api_key as the session_key) -- if you need help with that start a new thread and mention me in the question, I’ll jump on it and walk you through how to do it.

Userlevel 1

@PaulKortman Thank you for your answer.

This might be useful  in the future but for now, I went a simpler way, just making an additional request to fetch customer info when calling performSubscribe function.