Shared
API
curl -X GET "https://app.devguard.ch/api/assets/?organizationId=UUID" \
-H "Authorization: Bearer dvg_your_token_here" \
-H "Content-Type: application/json"const url = 'https://app.devguard.ch/api/assets/?organizationId=UUID';
const res = await fetch(url,
{
method: 'GET',
headers: {
'Authorization': 'Bearer dvg_your_token_here',
'Content-Type': 'application/json',
},
});
const data = await res.json();
console.log(data);import requests
url = "https://app.devguard.ch/api/assets/"
params = {"organizationId": "UUID"}
headers = {
"Authorization": "Bearer dvg_your_token_here",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())use reqwest::blocking::Client;
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
let client = Client::new();
let url = "https://app.devguard.ch/api/assets/";
let org_id = "UUID";
let res = client
.get(url)
.query(&[("organizationId", org_id)])
.header("Authorization", "Bearer dvg_your_token_here")
.header("Content-Type", "application/json")
.send()?;
let body = res.text()?;
println!("{}", body);
Ok(())
}import java.net.http.*;
import java.net.URI;
import java.io.IOException;
public class DevguardExample {
public static void main(String[] args) throws IOException, InterruptedException {
String token = "dvg_your_token_here";
String orgId = "UUID";
String url = "https://app.devguard.ch/api/assets/?organizationId=" + orgId;
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer " + token)
.header("Content-Type", "application/json")
.GET()
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}How is this guide?