Hi Expert, good day.
I am trying to query data from a API URL on a specific table as shown in the picture below (using postman)
I am trying to build this into Alteryx workflow but i not sure where should i put the following command in my workflow.
{
"query_param": {
"table": "p_smar_dpm_report_profile",
"pagination": "page",
"page_target" : 1,
"length_per_page" : 5,
"order" :[
]
}
}
Please help me out as i think i stuck on something.
Thanks
Solved! Go to Solution.
Hi @ElwinPang , you are passing the body in the text file, this is the reason for the workflow throwing an error of HTTP/1.1 401 Unauthorized. Try passing the credentials that you might be using in the postman to fetch data from the API, then configure the header and payload in the download tool of alteryx. This might work for you and you may get the desired data. For instance, please refer to the screenshot. It requires authorization in order to access the api in alteryx.
Hi @grazitti_sapna, thanks alot for point out the "unauthorized" error.
But my main issue is i not success to contract the payload part to include below "query_param"
{ |
"query_param": { |
"table": "p_smar_dpm_m_site_data_inclusive", |
"columns": [], |
"join": {}, |
"condition": {}, |
"pagination": "page", |
"page_target" : 1, |
"length_per_page" : 100 |
} |
} |
Hi @ElwinPang , I noticed that the error specifies you are using array in the query after looking into the query you mentioned "columns": [], I believe you need to replace with columns":{} to make it work. I hoe this works.
@ElwinPang wrote:Hi @grazitti_sapna, thanks alot for point out the "unauthorized" error.
But my main issue is i not success to contract the payload part to include below "query_param"
{ "query_param": { "table": "p_smar_dpm_m_site_data_inclusive", "columns": [], "join": {}, "condition": {}, "pagination": "page", "page_target" : 1, "length_per_page" : 100 } }