cancel
Showing results for 
Search instead for 
Did you mean: 

Issue while consuming API, using create_by_url

viva_kd
Explorer
0 Kudos

Dear Experts,

When i Am trying to consume API, i am getting error "invalid Command :action=get"

below is sample api, 

http://123.45.678.901:1234/WXYZ/api.svc/v2/attendance-daily?action=get;field-name=userid,username; date-range=01012023-02012023 

i am trying to consume via "cl_http_client=>create_by_url", 
is it possible to consume api having semicolon(;), or is this problem with wording in api action=get,

are both supported in api, please let me know your insight on this.

 

View Entire Topic
Sandra_Rossi
Active Contributor
0 Kudos

Try with %3B instead of ;

data(semicolon_url_escaped) = escape( val    = ';'
                                      format = cl_abap_format=>e_uri ).

Percent-encoding - Wikipedia

viva_kd
Explorer
0 Kudos
thanks @Sandra_Rossi for your valuable feedback,, still getting error as below
viva_kd
Explorer
0 Kudos
thanks @Sandra_Rossi for your valuable feedback,, still getting error as below -> failed: 0010001004 : Invalid command : action=get;field-name=userid,username,siteid,punch1_date,Punch1_Time,OutPunch_Date,OutPunch_Time,WorkTime_HHMM,WorkingShift,firsthalf,secondhalf;date-range=01.01.2023-02.01.2023
Sandra_Rossi
Active Contributor
0 Kudos
Good, it solves the semicolon error, but now the actual error is that it's an invalid command. Please refer to the documentation of your API, test it using Postman or whatever software.