BookmarkSubscribeRSS Feed
bharathirajact
Calcite | Level 5

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

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

Long shot, but try removing the %str() functions just in case quoting creates an issue

bharathirajact
Calcite | Level 5

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

ChrisNZ
Tourmaline | Level 20
Mmm the warnings are expected so don't worry about them. But the error 400 means malformed address. So something is not quite right somewhere
ChrisBrooks
Ammonite | Level 13

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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1906 views
  • 0 likes
  • 3 in conversation