Forum Discussion
ShadiHashem1
7 years agoQrew Cadet
Thanks for your response..
Python aside as I should be able to work with JSON requests through the webhook feature..
However I still have a problem with my Oauth credential.
I have set up Oath to run in javascript in a code page, which will be executed on a formula button.
this does prompt the user with the consent screen, but when I try to run a webhook afterwards using the JSON method, I get error messages that I am not authorized / logged in.
seems that either QB dropping the token extremely fast or not able to store it at all.
Any advise on this issue ?
Thanks
Python aside as I should be able to work with JSON requests through the webhook feature..
However I still have a problem with my Oauth credential.
I have set up Oath to run in javascript in a code page, which will be executed on a formula button.
this does prompt the user with the consent screen, but when I try to run a webhook afterwards using the JSON method, I get error messages that I am not authorized / logged in.
seems that either QB dropping the token extremely fast or not able to store it at all.
Any advise on this issue ?
Thanks
ShadiHashem1
7 years agoQrew Cadet
Hi Dan,
Sorry for the late reply.
Now the actual auth is working and the google api passes back its access token to the users. But my problem is I am unable to store this access token for the user and use it in other API calls inside QB.
When trying to set up a webhook I would need to pass that access token manually in the URL to make a succesful call.
I seem to have similar issues with other tokens which are not native QB tokens.
Is there someway to store an access token from a 3rd party either in a temporary QB record or in the local.storage of the user and then recall it from inside QB when triggering a webhooks ?
My codepage looks like this:
/*
* Create form to request access token from Google's OAuth 2.0 server.
*/
oauthSignIn();
function oauthSignIn() {
// Google's OAuth 2.0 endpoint for requesting an access token
var oauth2Endpoint = 'https://accounts.google.com/o/oauth2/v2/auth';
// Create <form> element to submit parameters to OAuth 2.0 endpoint.
var form = document.createElement('form');
form.setAttribute('method', 'GET'); // Send as a GET request.
form.setAttribute('action', oauth2Endpoint);
// Parameters to pass to OAuth 2.0 endpoint.
var params = {'client_id': 'xxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com',
'redirect_uri': 'https://domain.quickbase.com/db/bnzms2m4f',
'response_type': 'token',
'scope': 'https://www.googleapis.com/auth/dfatrafficking https://www.googleapis.com/auth/dfareporting https://www.googleapis.com/auth/ddmconversions',
'include_granted_scopes': 'true',
'state': 'pass-through value'};
// Add form parameters as hidden input values.
for (var p in params) {
var input = document.createElement('input');
input.setAttribute('type', 'hidden');
input.setAttribute('name', p);
input.setAttribute('value', params
Sorry for the late reply.
Now the actual auth is working and the google api passes back its access token to the users. But my problem is I am unable to store this access token for the user and use it in other API calls inside QB.
When trying to set up a webhook I would need to pass that access token manually in the URL to make a succesful call.
I seem to have similar issues with other tokens which are not native QB tokens.
Is there someway to store an access token from a 3rd party either in a temporary QB record or in the local.storage of the user and then recall it from inside QB when triggering a webhooks ?
My codepage looks like this:
/*
* Create form to request access token from Google's OAuth 2.0 server.
*/
oauthSignIn();
function oauthSignIn() {
// Google's OAuth 2.0 endpoint for requesting an access token
var oauth2Endpoint = 'https://accounts.google.com/o/oauth2/v2/auth';
// Create <form> element to submit parameters to OAuth 2.0 endpoint.
var form = document.createElement('form');
form.setAttribute('method', 'GET'); // Send as a GET request.
form.setAttribute('action', oauth2Endpoint);
// Parameters to pass to OAuth 2.0 endpoint.
var params = {'client_id': 'xxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com',
'redirect_uri': 'https://domain.quickbase.com/db/bnzms2m4f',
'response_type': 'token',
'scope': 'https://www.googleapis.com/auth/dfatrafficking https://www.googleapis.com/auth/dfareporting https://www.googleapis.com/auth/ddmconversions',
'include_granted_scopes': 'true',
'state': 'pass-through value'};
// Add form parameters as hidden input values.
for (var p in params) {
var input = document.createElement('input');
input.setAttribute('type', 'hidden');
input.setAttribute('name', p);
input.setAttribute('value', params
);
form.appendChild(input);
}
// Add form to page and submit it to open the OAuth 2.0 endpoint.
document.body.appendChild(form);
form.submit();
console.log(params);
}
Thanks
Best regards
Shadi