createLabel
create a new label
/label
Usage and SDK Samples
curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Basic [[basicHash]]" "https://raw.githubusercontent.com/api/label"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.HierarchyApi;
import java.io.File;
import java.util.*;
public class HierarchyApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure HTTP basic authorization: bearerAuth
HttpBasicAuth bearerAuth = (HttpBasicAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setUsername("YOUR USERNAME");
bearerAuth.setPassword("YOUR PASSWORD");
// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");
HierarchyApi apiInstance = new HierarchyApi();
Label label = ; // Label |
try {
Label result = apiInstance.createLabel(label);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HierarchyApi#createLabel");
e.printStackTrace();
}
}
}
import org.openapitools.client.api.HierarchyApi;
public class HierarchyApiExample {
public static void main(String[] args) {
HierarchyApi apiInstance = new HierarchyApi();
Label label = ; // Label |
try {
Label result = apiInstance.createLabel(label);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HierarchyApi#createLabel");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: bearerAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
Label *label = ; // (optional)
HierarchyApi *apiInstance = [[HierarchyApi alloc] init];
// create a new label
[apiInstance createLabelWith:label
completionHandler: ^(Label output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var ArgosService = require('argos_service');
var defaultClient = ArgosService.ApiClient.instance;
// Configure HTTP basic authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.username = 'YOUR USERNAME'
bearerAuth.password = 'YOUR PASSWORD'
var api = new ArgosService.HierarchyApi()
var opts = {
'label': // {Label}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createLabel(opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class createLabelExample
{
public void main()
{
// Configure HTTP basic authorization: bearerAuth
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
var apiInstance = new HierarchyApi();
var label = new Label(); // Label | (optional)
try
{
// create a new label
Label result = apiInstance.createLabel(label);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling HierarchyApi.createLabel: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: bearerAuth
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new OpenAPITools\Client\Api\HierarchyApi();
$label = ; // Label |
try {
$result = $api_instance->createLabel($label);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HierarchyApi->createLabel: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::HierarchyApi;
# Configure HTTP basic authorization: bearerAuth
$WWW::OPenAPIClient::Configuration::username = 'YOUR_USERNAME';
$WWW::OPenAPIClient::Configuration::password = 'YOUR_PASSWORD';
my $api_instance = WWW::OPenAPIClient::HierarchyApi->new();
my $label = WWW::OPenAPIClient::Object::Label->new(); # Label |
eval {
my $result = $api_instance->createLabel(label => $label);
print Dumper($result);
};
if ($@) {
warn "Exception when calling HierarchyApi->createLabel: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: bearerAuth
openapi_client.configuration.username = 'YOUR_USERNAME'
openapi_client.configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = openapi_client.HierarchyApi()
label = # Label | (optional)
try:
# create a new label
api_response = api_instance.create_label(label=label)
pprint(api_response)
except ApiException as e:
print("Exception when calling HierarchyApi->createLabel: %s\n" % e)
extern crate HierarchyApi;
pub fn main() {
let label = ; // Label
let mut context = HierarchyApi::Context::default();
let result = client.createLabel(label, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
label |
{
Required: name
id:
undefined
name:
undefined
parentLabelId:
undefined
|
Responses
Status: 201 - created label
Name | Type | Format | Description |
---|---|---|---|
Location | URI | uri | location where the created label can be found |