Save a responseText to field after API Post request

  • 0
  • 1
  • Question
  • Updated 3 months ago
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: 
  1. {readyState: 1, setRequestHeader: ƒ, getAllResponseHeaders: ƒ, getResponseHeader: ƒ, overrideMimeType: ƒ, ...}
    1. abort: ƒ (a)
    2. always: ƒ ()
    3. complete: ƒ ()
    4. done: ƒ ()
    5. error: ƒ ()
    6. fail: ƒ ()
    7. getAllResponseHeaders: ƒ ()
    8. getResponseHeader: ƒ (a)
    9. isRejected: ƒ ()
    10. isResolved: ƒ ()
    11. overrideMimeType: ƒ (a)
    12. pipe: ƒ (a,b,c)
    13. progress: ƒ ()
    14. promise: ƒ (a)
    15. readyState: 4
    16. responseText: "{"returnCode":"9999","return":" response generated and valid until .","returnData":null,"sessionData":"XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX"}"
    17. setRequestHeader: ƒ (a,b)
    18. state: ƒ ()
    19. status: 200
    20. statusCode: ƒ (a)
    21. statusText: "OK"
    22. success: ƒ ()
    23. then: ƒ (a,b,c)
    24. __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


Photo of Shadi Hashem

Shadi Hashem

  • 222 Points 100 badge 2x thumb

Posted 3 months ago

  • 0
  • 1

Be the first to post a reply!