Basic Authentication requires your HTTP request to contain the specific header Authorization. Four simple steps are required to set the header to the correct value:
For your username is "ltu" and your password is "technologies" then the Authorization header should look like:
Basic bHR1OnRlY2hub2xvZ2llcw==
You can find all about Basic Authentication on Wikipedia.
All the requests to the API should be using HTTPS this way all the data transferred is encrypted and secured. So make sure to direct your requests to the correct URL:
curl -i -u ltu:technologies https://cloud.ltutech.com/api/v1/projects/
If during testing - with curl for example - you get an error that looks like this:
curl: (60) SSL certificate problem, verify that the CA cert is OK.
you need to download LTU's certificate.
For the current user if the certificate is named ltutech.com.cacert you can specify its path in a curl command for example:
curl -i -u ltu:technologies --cacert ~/ltutech.com.cacert https://cloud.ltutech.com/api/v1/projects/
For example, to delete all the Visuals within a given project you could launch the following bash script:
#!/bin/bash PROJECT_ID="1" CREDENTIALS="ltu:technologies" while true; do # build the list of the first Visual URLs visual_urls=$(curl -u $CREDENTIALS https://cloud.ltutech.com/api/v1/projects/$PROJECT_ID/visuals/ \ | egrep -o 'https://cloud.ltutech.com/api/v1/projects/visuals/[0-9]*/' | uniq) # Process the Visuals one by one for visual in $visual_urls; do curl -u $CREDENTIALS -X DELETE $visual done # exit when the list is empty [ "$visual_urls" != "" ] || break done