authorisationApprove
Performs authorisation approval
If no authorisation code has been generated but one is required, the first call to this endpoint will generate a code and send it to the user as an alert. Subsequent calls require the code to be submitted in the request body. If the user fails to enter the code correctly after three attempts, a new code will be required.Once the Authorisation status reaches Approved, Rejected or Complete the user will no longer be able to submit an approval.
/Spenda/Authorisations/{authorisationID}/Approve
Usage and SDK Samples
curl -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"https://api.dev.spenda.co/api/Spenda/Authorisations/{authorisationID}/Approve" \
-d ''
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
// Create an instance of the API class
DefaultApi apiInstance = new DefaultApi();
Integer authorisationID = 56; // Integer | Identifier of the authorisation to approve.
SubmitApprovalCodeRequest submitApprovalCodeRequest = {"approvalCode":"string"}; // SubmitApprovalCodeRequest |
try {
authorisationResponse result = apiInstance.authorisationApprove(authorisationID, submitApprovalCodeRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#authorisationApprove");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final Integer authorisationID = new Integer(); // Integer | Identifier of the authorisation to approve.
final SubmitApprovalCodeRequest submitApprovalCodeRequest = new SubmitApprovalCodeRequest(); // SubmitApprovalCodeRequest |
try {
final result = await api_instance.authorisationApprove(authorisationID, submitApprovalCodeRequest);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->authorisationApprove: $e\n');
}
import org.openapitools.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
Integer authorisationID = 56; // Integer | Identifier of the authorisation to approve.
SubmitApprovalCodeRequest submitApprovalCodeRequest = {"approvalCode":"string"}; // SubmitApprovalCodeRequest |
try {
authorisationResponse result = apiInstance.authorisationApprove(authorisationID, submitApprovalCodeRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#authorisationApprove");
e.printStackTrace();
}
}
}
// Create an instance of the API class
DefaultApi *apiInstance = [[DefaultApi alloc] init];
Integer *authorisationID = 56; // Identifier of the authorisation to approve. (default to null)
SubmitApprovalCodeRequest *submitApprovalCodeRequest = {"approvalCode":"string"}; // (optional)
// Performs authorisation approval
[apiInstance authorisationApproveWith:authorisationID
submitApprovalCodeRequest:submitApprovalCodeRequest
completionHandler: ^(authorisationResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SpendaServicesAuthorisation = require('spenda_services_authorisation');
// Create an instance of the API class
var api = new SpendaServicesAuthorisation.DefaultApi()
var authorisationID = 56; // {Integer} Identifier of the authorisation to approve.
var opts = {
'submitApprovalCodeRequest': {"approvalCode":"string"} // {SubmitApprovalCodeRequest}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.authorisationApprove(authorisationID, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class authorisationApproveExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new DefaultApi();
var authorisationID = 56; // Integer | Identifier of the authorisation to approve. (default to null)
var submitApprovalCodeRequest = new SubmitApprovalCodeRequest(); // SubmitApprovalCodeRequest | (optional)
try {
// Performs authorisation approval
authorisationResponse result = apiInstance.authorisationApprove(authorisationID, submitApprovalCodeRequest);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling DefaultApi.authorisationApprove: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\DefaultApi();
$authorisationID = 56; // Integer | Identifier of the authorisation to approve.
$submitApprovalCodeRequest = {"approvalCode":"string"}; // SubmitApprovalCodeRequest |
try {
$result = $api_instance->authorisationApprove($authorisationID, $submitApprovalCodeRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->authorisationApprove: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::DefaultApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::DefaultApi->new();
my $authorisationID = 56; # Integer | Identifier of the authorisation to approve.
my $submitApprovalCodeRequest = WWW::OPenAPIClient::Object::SubmitApprovalCodeRequest->new(); # SubmitApprovalCodeRequest |
eval {
my $result = $api_instance->authorisationApprove(authorisationID => $authorisationID, submitApprovalCodeRequest => $submitApprovalCodeRequest);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->authorisationApprove: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
authorisationID = 56 # Integer | Identifier of the authorisation to approve. (default to null)
submitApprovalCodeRequest = {"approvalCode":"string"} # SubmitApprovalCodeRequest | (optional)
try:
# Performs authorisation approval
api_response = api_instance.authorisation_approve(authorisationID, submitApprovalCodeRequest=submitApprovalCodeRequest)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->authorisationApprove: %s\n" % e)
extern crate DefaultApi;
pub fn main() {
let authorisationID = 56; // Integer
let submitApprovalCodeRequest = {"approvalCode":"string"}; // SubmitApprovalCodeRequest
let mut context = DefaultApi::Context::default();
let result = client.authorisationApprove(authorisationID, submitApprovalCodeRequest, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
| Name | Description |
|---|---|
| authorisationID* |
| Name | Description |
|---|---|
| submitApprovalCodeRequest |
Request containing the approval code, if known. |