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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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