Forum Discussion
AustinK
5 years agoQrew Commander
I know this is a simple thing but are you supplying the app token in the URL? Since it looks like your whole call is in the URL it may not work to put the app token in the body of the request in this case. So maybe we have to make a choice here. Either do everything via the URL or do it all in the body of the webhook.
I just tested this with AddRecord and the only way it worked was if I supplied the app token and user token in the body of the request. When I tried using my username and password in the Pipeline it always said there was an error and I needed to sign in.
What I have to do is set it up exactly as I would a webhook. So that means the URL I am calling is mycompany.quickbase.com/db/DBID and then you add the request headers which are "QUICKBASE-ACTION" and "API_AddRecord" near the bottom of the webhook.
All the fields above the part of my screenshot are blank. Hopefully this is helpful for you but I know I didn't do the same api call as you did in my screenshot but i DID test GenResultsTable and was able to get a return via the same method.
Here is the screenshot for GenResultsTable which as I said did give me a result.
I just tested this with AddRecord and the only way it worked was if I supplied the app token and user token in the body of the request. When I tried using my username and password in the Pipeline it always said there was an error and I needed to sign in.
What I have to do is set it up exactly as I would a webhook. So that means the URL I am calling is mycompany.quickbase.com/db/DBID and then you add the request headers which are "QUICKBASE-ACTION" and "API_AddRecord" near the bottom of the webhook.
All the fields above the part of my screenshot are blank. Hopefully this is helpful for you but I know I didn't do the same api call as you did in my screenshot but i DID test GenResultsTable and was able to get a return via the same method.
Here is the screenshot for GenResultsTable which as I said did give me a result.
MarkShnier__You
Qrew Legend
5 years agoWell that was an incredibly helpful response. It would difficult to enumerate all the things I was doing wrong. I have managed to get past that Authentication issue and generate a CSV response.
So my real purpose of this was to simulate an external API call to another non QuickBase system which would return a CSV file back. I am anticipating that need from my clients as a common response format from external systems is CSV.
Separately, I was also successful with the new Bulk Record functionality QuickBase which allow a step to create a Bulk Record "Upsert" (I had to google that word - it means to update or insert if not there). Then you add rows to the Bulk Record Upsert and then when done adding rows you "Commit" the Bulk Record Upsert and it will update or add new records.
So my next goal is to coax the returned CSV table into a Bulk Record Upsert.
My problem is that I do not know how to convert or iterate though the returned CSV data from the API_GenResultsTable. Strangely, when i change the API call to respond in format Application/json as opposed to Application/xml my Pipeline once again failed to Authorize. I was trying that because I saw that there was a Channel for JSON Responses that might be useful.
Any ideas out there how to convert a CSV response from a API call into a Bulk Record Upsert?
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
So my real purpose of this was to simulate an external API call to another non QuickBase system which would return a CSV file back. I am anticipating that need from my clients as a common response format from external systems is CSV.
Separately, I was also successful with the new Bulk Record functionality QuickBase which allow a step to create a Bulk Record "Upsert" (I had to google that word - it means to update or insert if not there). Then you add rows to the Bulk Record Upsert and then when done adding rows you "Commit" the Bulk Record Upsert and it will update or add new records.
So my next goal is to coax the returned CSV table into a Bulk Record Upsert.
My problem is that I do not know how to convert or iterate though the returned CSV data from the API_GenResultsTable. Strangely, when i change the API call to respond in format Application/json as opposed to Application/xml my Pipeline once again failed to Authorize. I was trying that because I saw that there was a Channel for JSON Responses that might be useful.
Any ideas out there how to convert a CSV response from a API call into a Bulk Record Upsert?
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- AustinK5 years agoQrew CommanderIn the future the JSON part will prove to valuable for things like this but right now as far as I know Quick Base returns things as xml.
I see a big issue with my pipeline and that is that although I have selected application/xml it still thinks I should be receiving or maybe sending JSON for some reason. When I go to the next step after the request it says my request should have included JSON and makes no mention of any returned data or how I might be able to use it. So it kind of seems like you can make that API call but do nothing else.
Maybe I am doing something wrong here but I just cannot figure out how to use my returned object.- MarkShnier__You5 years ago
Qrew Legend
Austin, you got me quite far, and now I have asked Support for help. The question is if you can get an API response from a 3rd party system in CSV format, how can you use it? Or can you only use a JSON format response.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------