client.request() using secure parameter in manifest.json

4 Comentarios

  • Blog Beginner

    This worked with the following code. 

    const oAuthResponse = await client.request({
          type: 'POST',
          url: "https://api-m.paypal.com/v1/oauth2/token",
          contentType: 'application/json',
          headers: { "Authorization": "Basic {{setting.client_secret}}", "Accept": "application/json"},
          data: 'grant_type=client_credentials',
          cors: false,
          secure: true,
          httpCompleteResponse: true
        }
      ).then(function(data) {
          console.log('...oAuthResponse', data);
          return data;
      });

    So the data field should have been text instead of JSON. 

    1
  • Tipene Hughes
    Zendesk Developer Advocacy

    Hi Blog Beginner,

    Glad to see you got it figured out, and thanks for updating us!

    Have a great day :) 

    Tipene

    0
  • Ravi

    Hi Tipene Hughes,

    I am also tring to access secure settings but facing same issue with bearer token. Attached screenshot of error and code.
    Any help would be appriciated.


    0
  • Tipene Hughes
    Zendesk Developer Advocacy

    Hey, Ravi!

    Can you confirm that you have a domain whitelist correctly configured in your manifest.json file? You can read more about domainWhitelist here:

    https://developer.zendesk.com/documentation/apps/app-developer-guide/manifest/#domainwhitelist

    Thanks!

    Tipene

    1

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk