addSubUser
Add new sub user.
/add
Usage and SDK Samples
curl -X PUT\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"https://gopi.apix.fi/subuser/add?TraID=&t=&d=SHA-256:<digest>="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
SubUser body = {
"username" : "tester@firma.fi",
"createPurchaseInvoice" : true,
"createSellInvoice" : true,
"adminSelector" : false,
"payslip" : false
}; // SubUser | Sub user to add
String traID = traID_example; // String | pass authenticating user transfer ID
String t = t_example; // String | timestamp in YYYYMMDDHHmmss format (UTC)
String d=SHA256 = d=SHA256_example; // String | SHA256 digest string of parameters and secret (TraID+t+TransferKey) prepended with 'SHA-256:'
try {
SubUser result = apiInstance.addSubUser(body, traID, t, d=SHA256);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addSubUser");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
SubUser body = {
"username" : "tester@firma.fi",
"createPurchaseInvoice" : true,
"createSellInvoice" : true,
"adminSelector" : false,
"payslip" : false
}; // SubUser | Sub user to add
String traID = traID_example; // String | pass authenticating user transfer ID
String t = t_example; // String | timestamp in YYYYMMDDHHmmss format (UTC)
String d=SHA256 = d=SHA256_example; // String | SHA256 digest string of parameters and secret (TraID+t+TransferKey) prepended with 'SHA-256:'
try {
SubUser result = apiInstance.addSubUser(body, traID, t, d=SHA256);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#addSubUser");
e.printStackTrace();
}
}
}
SubUser *body = {
"username" : "tester@firma.fi",
"createPurchaseInvoice" : true,
"createSellInvoice" : true,
"adminSelector" : false,
"payslip" : false
}; // Sub user to add
String *traID = traID_example; // pass authenticating user transfer ID
String *t = t_example; // timestamp in YYYYMMDDHHmmss format (UTC)
String *d=SHA256<digest> = d=SHA256_example; // SHA256 digest string of parameters and secret (TraID+t+TransferKey) prepended with 'SHA-256:'
DefaultApi *apiInstance = [[DefaultApi alloc] init];
// Add new sub user.
[apiInstance addSubUserWith:body
traID:traID
t:t
d=SHA256<digest>:d=SHA256<digest>
completionHandler: ^(SubUser output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SubUserApi = require('sub_user_api');
var api = new SubUserApi.DefaultApi()
var body = {
"username" : "tester@firma.fi",
"createPurchaseInvoice" : true,
"createSellInvoice" : true,
"adminSelector" : false,
"payslip" : false
}; // {{SubUser}} Sub user to add
var traID = traID_example; // {{String}} pass authenticating user transfer ID
var t = t_example; // {{String}} timestamp in YYYYMMDDHHmmss format (UTC)
var d=SHA256 = d=SHA256_example; // {{String}} SHA256 digest string of parameters and secret (TraID+t+TransferKey) prepended with 'SHA-256:'
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.addSubUser(bodytraIDtd=SHA256, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class addSubUserExample
{
public void main()
{
var apiInstance = new DefaultApi();
var body = new SubUser(); // SubUser | Sub user to add
var traID = traID_example; // String | pass authenticating user transfer ID
var t = t_example; // String | timestamp in YYYYMMDDHHmmss format (UTC)
var d=SHA256<digest> = d=SHA256_example; // String | SHA256 digest string of parameters and secret (TraID+t+TransferKey) prepended with 'SHA-256:'
try
{
// Add new sub user.
SubUser result = apiInstance.addSubUser(body, traID, t, d=SHA256<digest>);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.addSubUser: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiDefaultApi();
$body = {
"username" : "tester@firma.fi",
"createPurchaseInvoice" : true,
"createSellInvoice" : true,
"adminSelector" : false,
"payslip" : false
}; // SubUser | Sub user to add
$traID = traID_example; // String | pass authenticating user transfer ID
$t = t_example; // String | timestamp in YYYYMMDDHHmmss format (UTC)
$d=SHA256<digest> = d=SHA256_example; // String | SHA256 digest string of parameters and secret (TraID+t+TransferKey) prepended with 'SHA-256:'
try {
$result = $api_instance->addSubUser($body, $traID, $t, $d=SHA256<digest>);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->addSubUser: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $body = WWW::SwaggerClient::Object::SubUser->new(); # SubUser | Sub user to add
my $traID = traID_example; # String | pass authenticating user transfer ID
my $t = t_example; # String | timestamp in YYYYMMDDHHmmss format (UTC)
my $d=SHA256<digest> = d=SHA256_example; # String | SHA256 digest string of parameters and secret (TraID+t+TransferKey) prepended with 'SHA-256:'
eval {
my $result = $api_instance->addSubUser(body => $body, traID => $traID, t => $t, d=SHA256<digest> => $d=SHA256<digest>);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->addSubUser: $@\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.DefaultApi()
body = {
"username" : "tester@firma.fi",
"createPurchaseInvoice" : true,
"createSellInvoice" : true,
"adminSelector" : false,
"payslip" : false
} # SubUser | Sub user to add
traID = traID_example # String | pass authenticating user transfer ID
t = t_example # String | timestamp in YYYYMMDDHHmmss format (UTC)
d=SHA256<digest> = d=SHA256_example # String | SHA256 digest string of parameters and secret (TraID+t+TransferKey) prepended with 'SHA-256:'
try:
# Add new sub user.
api_response = api_instance.add_sub_user(body, traID, t, d=SHA256<digest>)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->addSubUser: %s\n" % e)
Parameters
Body parameters
Name | Description |
---|---|
body * |
Query parameters
Name | Description |
---|---|
TraID* |
String
pass authenticating user transfer ID
Required
|
t* |
String
timestamp in YYYYMMDDHHmmss format (UTC)
Required
|
d=SHA-256:<digest>* |
String
SHA256 digest string of parameters and secret (TraID+t+TransferKey) prepended with 'SHA-256:'
Required
|