<POST> Generate Model ID
1 min
The Generate Model ID API is used to create a unique model ID and generate a presigned URL for uploading a file. The model ID acts as an identifier for the Supply Chain Analysis when repo_type is set to "file".
generate_model_id
This API generates a unique model ID and provides a presigned URL for uploading a model file, which is required for Supply Chain Analysis when repo_type="file".
POST
https://api.aws.boschaishield.com/prod/api/ais/v1.5/generate_model_id
Header Parameters
- x-api-keystringrequiredDescription
- Org-IdstringrequiredDescription
python
import requests
url = "https://api.aws.boschaishield.com/prod/api/ais/v1.5/generate_model_id"
payload = {}
headers = {
'x-api-key': 'string',
'Org-Id': 'string'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
curl
curl --location --request POST 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/generate_model_id' \
--header 'x-api-key: string' \
--header 'Org-Id: string'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.aws.boschaishield.com/prod/api/ais/v1.5/generate_model_id',
'headers': {
'x-api-key': 'string',
'Org-Id': 'string'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("x-api-key", "string");
myHeaders.append("Org-Id", "string");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.aws.boschaishield.com/prod/api/ais/v1.5/generate_model_id", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "net/http"
url = URI("https://api.aws.boschaishield.com/prod/api/ais/v1.5/generate_model_id")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = "string"
request["Org-Id"] = "string"
response = https.request(request)
puts response.read_body
200
{
"api_version": "1.5",
"artifact_path": {
"fields": {
"key": "xxxxx",
"policy": "xxxxx",
"x-amz-algorithm": "xxxxx",
"x-amz-credential": "xxxxx",
"x-amz-date": "xxxxx",
"x-amz-signature": "xxxxx"
},
"url": "xxxxx"
},
"model_id": "xxxxx"
}401
// 401 Unauthorized: Returns an error message if the provided API key or Org-ID is invalid or expired.400
// 400 Bad request Error: Returns an error message if the application cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, etc.)412
// 412 precondition failed: Returns an error message if access to the target resource has been denied. (For example- if any of the parameter value is incorrect or license has expired)