Hi Team -
Am trying to get the data from JIRA REST API using HTTP PROC.
SAS CODE:
proc http
method="GET"
url="http://servername:8080/rest/api/2/search?%str(&)fields=project,status%str(&)jql=project=C12395"
webusername="username"
webpassword="password"
ct="application/JSON"
out=resp;
run;
Am getting error/response code as 400.
NOTE: Call to [http://servername:8080/rest/api/2/search?&fields=project,
status&jql=project=C12395] returned [400]
NOTE: Procedure http step took :
real time : 0.628
cpu time : 0.031
Am really not sure what am missing. Same JIRA REST API URL working in JAVA.
Thanks!
Bharathi
Long shot, but try removing the %str() functions just in case quoting creates an issue
Thank you ChrisNZ, Still am getting http return code is 400.
proc http
22 webusername="&username"
23 webpassword=XXXXXX
24 /*url="http://servername:8080/rest/api/2/issue/12637"
25 */
26 url="http://servername:8080/rest/api/2/search?&fields=project,status&jql=project=C00095"
WARNING: Macro variable "&fields" was not resolved
WARNING: Macro variable "&jql" was not resolved
WARNING: Macro variable "&jql" was not resolved
27
28 method="GET"
29 ct="application/json"
30 out=resp
31 headerout=headers
32
33 ;
34 run;
NOTE: Call to [http://l4dvedap4329:8080/rest/api/2/search?&fields=project,status&jql=project=C00095] returned [400]
35
36 %echofile(resp);
NOTE: Procedure http step took :
real time : 2.153
cpu time : 0.873
Please advice why am not able to make a call from WPS, same url working fine in browser.
Thanks!
Bharathi
If you're using WPS you should really ask them rather than use a SAS forum given the history between the two companies https://en.wikipedia.org/wiki/SAS_Institute_Inc_v_World_Programming_Ltd
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.