addSubmission
Submit a new a safety submission to the system
/safety/submission
Usage and SDK Samples
curl -X POST "https://opensafety.zone/v2/safety/submission"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SafetyDataApi;
import java.io.File;
import java.util.*;
public class SafetyDataApiExample {
public static void main(String[] args) {
SafetyDataApi apiInstance = new SafetyDataApi();
Submission body = ; // Submission | Safety object that needs to be added to the system
try {
apiInstance.addSubmission(body);
} catch (ApiException e) {
System.err.println("Exception when calling SafetyDataApi#addSubmission");
e.printStackTrace();
}
}
}
import io.swagger.client.api.SafetyDataApi;
public class SafetyDataApiExample {
public static void main(String[] args) {
SafetyDataApi apiInstance = new SafetyDataApi();
Submission body = ; // Submission | Safety object that needs to be added to the system
try {
apiInstance.addSubmission(body);
} catch (ApiException e) {
System.err.println("Exception when calling SafetyDataApi#addSubmission");
e.printStackTrace();
}
}
}
Submission *body = ; // Safety object that needs to be added to the system
SafetyDataApi *apiInstance = [[SafetyDataApi alloc] init];
// Submit a new a safety submission to the system
[apiInstance addSubmissionWith:body
completionHandler: ^(NSError* error) {
if (error) {
NSLog(@"Error: %@", error);
}
}];
var OpenSafety = require('open_safety');
var api = new OpenSafety.SafetyDataApi()
var body = ; // {Submission} Safety object that needs to be added to the system
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
api.addSubmission(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class addSubmissionExample
{
public void main()
{
var apiInstance = new SafetyDataApi();
var body = new Submission(); // Submission | Safety object that needs to be added to the system
try
{
// Submit a new a safety submission to the system
apiInstance.addSubmission(body);
}
catch (Exception e)
{
Debug.Print("Exception when calling SafetyDataApi.addSubmission: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\SafetyDataApi();
$body = ; // Submission | Safety object that needs to be added to the system
try {
$api_instance->addSubmission($body);
} catch (Exception $e) {
echo 'Exception when calling SafetyDataApi->addSubmission: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SafetyDataApi;
my $api_instance = WWW::SwaggerClient::SafetyDataApi->new();
my $body = WWW::SwaggerClient::Object::Submission->new(); # Submission | Safety object that needs to be added to the system
eval {
$api_instance->addSubmission(body => $body);
};
if ($@) {
warn "Exception when calling SafetyDataApi->addSubmission: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.SafetyDataApi()
body = # Submission | Safety object that needs to be added to the system
try:
# Submit a new a safety submission to the system
api_instance.add_submission(body)
except ApiException as e:
print("Exception when calling SafetyDataApi->addSubmission: %s\n" % e)
Parameters
Name | Description |
---|---|
body * |