Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Query specific table from a API URL

ElwinPang
8 - Asteroid

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)

ElwinPang_0-1591254751175.png

 

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

3 REPLIES 3
grazitti_sapna
17 - Castor

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.

grazitti_sapna_0-1591255993935.png

 

Sapna Gupta
ElwinPang
8 - Asteroid

Hi @grazitti_sapna, thanks alot for point out the "unauthorized" error. 

 

ElwinPang_0-1591258186160.png

 

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
}
}


 

grazitti_sapna
17 - Castor

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. 

 

ElwinPang_0-1591258186160.png

 

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
}
}


 


 

Sapna Gupta
Labels