ShadiHashem1
7 years agoQrew Cadet
Save a responseText to field after API Post request
I have created a code page to handle following post request:
$.ajax({
type: 'POST',
url: "https://API.Endpoint";,
processData: true,
data: {login: "XXXXX", password: "XXXX"},
dataType: "json",
success: function (data) {
processData(data);
}
});
function processData(data){
//Do some stuff with the data
}
I get a reponse like following:
I need to save the 16. responseText to a table, more specifically the "sessionData" to a field.
The "sessionData" contains a token, which I need to use in other API calls from inside quickbase.
How can I retrieve the sessionData in Quickbase and store it to a field, using the same code page as described above ?
Thanks in advance
$.ajax({
type: 'POST',
url: "https://API.Endpoint";,
processData: true,
data: {login: "XXXXX", password: "XXXX"},
dataType: "json",
success: function (data) {
processData(data);
}
});
function processData(data){
//Do some stuff with the data
}
I get a reponse like following:
- {readyState: 1, setRequestHeader: ?, getAllResponseHeaders: ?, getResponseHeader: ?, overrideMimeType: ?, ...}
- abort: ? (a)
- always: ? ()
- complete: ? ()
- done: ? ()
- error: ? ()
- fail: ? ()
- getAllResponseHeaders: ? ()
- getResponseHeader: ? (a)
- isRejected: ? ()
- isResolved: ? ()
- overrideMimeType: ? (a)
- pipe: ? (a,b,c)
- progress: ? ()
- promise: ? (a)
- readyState: 4
- responseText: "{"returnCode":"9999","return":" response generated and valid until .","returnData":null,"sessionData":"XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX"}"
- setRequestHeader: ? (a,b)
- state: ? ()
- status: 200
- statusCode: ? (a)
- statusText: "OK"
- success: ? ()
- then: ? (a,b,c)
- __proto__: Object
I need to save the 16. responseText to a table, more specifically the "sessionData" to a field.
The "sessionData" contains a token, which I need to use in other API calls from inside quickbase.
How can I retrieve the sessionData in Quickbase and store it to a field, using the same code page as described above ?
Thanks in advance