How to Use Wget for REST API Access


In some company environments, cURL might not be an approved software while Wget is. Learn to work with REST API using Wget.


The following approach works in test environments for downloading the JSON definition of artifacts. 

ENC='$(echo -n '<user>:<pass>' | openssl base64 -base64)' &&  wget --no-check-certificate -O artifact.json --header 'Accept:application/json' --header 'Authorization:Basic ${ENC}' 'https://<host>:8443/rest/<artifactType>/<configID>' 


Note that depending on the version you are using there might be limitations. For example Downloading Data Without an Export Job using a REST API call might not work:

ENC="$(echo -n '<user>:<pass>' | openssl base64 -base64)" && wget -t 1 --no-check-certificate -O content.csv -c --header "Accept:text/plain" --header "Authorization:Basic ${ENC}" "https://<host>:8443/rest/data/workbook/<configID>/<WorksheetName>/download"

Further Information

How to Upload the JSON Definition of Artifacts