addAttribute
updates (or creates) an attribute
Works with all entities, including nodes and edges. Given its key, updates an attribute value, or creates it, if it doesn't yet exist.
/{uuid}/attribute/{key}
Usage and SDK Samples
curl -X post "https://virtserver.swaggerhub.com/phonetworks/server-rest/1.1.0/{uuid}/attribute/{key}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import .DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String value = value_example; // String | The value to update the key with.
try {
inline_response_200_4 result = apiInstance.addAttribute(value);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addAttribute");
e.printStackTrace();
}
}
}
import .DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String value = value_example; // String | The value to update the key with.
try {
inline_response_200_4 result = apiInstance.addAttribute(value);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addAttribute");
e.printStackTrace();
}
}
}
String *value = value_example; // The value to update the key with. (optional)
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// updates (or creates) an attribute
[apiInstance addAttributeWith:value
completionHandler: ^(inline_response_200_4 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var = require('');
var api = new .DefaultApi()
var opts = {
'value': value_example // {String} The value to update the key with.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.addAttribute(opts, callback);
using System;
using System.Diagnostics;
using .Api;
using .Client;
using ;
namespace Example
{
public class addAttributeExample
{
public void main()
{
var apiInstance = new DefaultApi();
var value = value_example; // String | The value to update the key with. (optional)
try
{
// updates (or creates) an attribute
inline_response_200_4 result = apiInstance.addAttribute(value);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.addAttribute: " + e.Message );
}
}
}
}
addAttribute($value);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->addAttribute: ', $e->getMessage(), PHP_EOL;
}
Parameters
Name | Description |
---|---|
value |