client.request() secure parameter not working | Community
Skip to main content

client.request() secure parameter not working

  • April 27, 2022
  • 5 replies
  • 0 views

Matheus13

Hello everyone, I have a problem where I can't retrieve the values ​​filled in the app using client.request.

My parameter is configured as follows:

{
"name": "integrationKey",
 "type": "text",
 "required": true,
 "secure": true
}


When trying to call my method using client.request() my parameter is not populated correctly. The variable inside the {{setting.integrationKey}} is not recognized.

client
        .request({
          type: 'POST',
          url: 'https://jet-commerce.vercel.app/api/auth',
          contentType: 'application/json',
          headers: {
            Authorization: 'Basic {{setting.integrationKey}}',
            Accept: 'application/json'
          },
          data: '{{setting.integrationKey}}',
          cors: false,
          secure: true,
          httpCompleteResponse: true
        })
        .then(function (data) {
          console.log('my', data)
          return data['access_token']
        })


How can I retrieve these parameters to use in my code?

5 replies

Eric27
  • April 28, 2022
Hey Matheus, 

Are you serving your app from your local using ZAT or ZCLI? 
 
Thanks

Matheus13
  • Author
  • April 28, 2022

Hi @eric27,

I have the app privately in an environment that we have for testing in Zendesk. In this case I'm not testing in local, I'm installing the app on the platform. We have the app published and the same problem occurs.


Eric27
  • April 28, 2022
Hey Matheus,

Mind if I move this into a ticket so I can take a closer look?

Matheus13
  • Author
  • April 28, 2022

Hey Eric,

Please this would help me a lot as I can't retrieve the data from the safe parameters in my code.

Thank you in advance for your help


Eric27
  • April 28, 2022
Sounds good, I've opened up a ticket on your behalf. Look forward to working with you via that.

Thanks!