attachmentsGetFile
Get a file content
Allows an user to get file content
/Spenda/Attachments/{attachmentTypeID}/{attachmentGUID}
Usage and SDK Samples
curl -X GET \
-H "Accept: application/octet-stream" \
"https://api.dev.spenda.co/api/Spenda/Attachments/{attachmentTypeID}/{attachmentGUID}?t=true"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.AttachmentsApi;
import java.io.File;
import java.util.*;
public class AttachmentsApiExample {
public static void main(String[] args) {
// Create an instance of the API class
AttachmentsApi apiInstance = new AttachmentsApi();
Integer attachmentTypeID = 56; // Integer | Attachment type
UUID attachmentGUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Attachment unique identifier
Boolean t = true; // Boolean | Token representing the attachment details
try {
stream result = apiInstance.attachmentsGetFile(attachmentTypeID, attachmentGUID, t);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AttachmentsApi#attachmentsGetFile");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final Integer attachmentTypeID = new Integer(); // Integer | Attachment type
final UUID attachmentGUID = new UUID(); // UUID | Attachment unique identifier
final Boolean t = new Boolean(); // Boolean | Token representing the attachment details
try {
final result = await api_instance.attachmentsGetFile(attachmentTypeID, attachmentGUID, t);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->attachmentsGetFile: $e\n');
}
import org.openapitools.client.api.AttachmentsApi;
public class AttachmentsApiExample {
public static void main(String[] args) {
AttachmentsApi apiInstance = new AttachmentsApi();
Integer attachmentTypeID = 56; // Integer | Attachment type
UUID attachmentGUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Attachment unique identifier
Boolean t = true; // Boolean | Token representing the attachment details
try {
stream result = apiInstance.attachmentsGetFile(attachmentTypeID, attachmentGUID, t);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AttachmentsApi#attachmentsGetFile");
e.printStackTrace();
}
}
}
// Create an instance of the API class
AttachmentsApi *apiInstance = [[AttachmentsApi alloc] init];
Integer *attachmentTypeID = 56; // Attachment type (default to null)
UUID *attachmentGUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Attachment unique identifier (default to null)
Boolean *t = true; // Token representing the attachment details (default to null)
// Get a file content
[apiInstance attachmentsGetFileWith:attachmentTypeID
attachmentGUID:attachmentGUID
t:t
completionHandler: ^(stream output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SpendaServicesAttachments = require('spenda_services_attachments');
// Create an instance of the API class
var api = new SpendaServicesAttachments.AttachmentsApi()
var attachmentTypeID = 56; // {Integer} Attachment type
var attachmentGUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {UUID} Attachment unique identifier
var t = true; // {Boolean} Token representing the attachment details
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.attachmentsGetFile(attachmentTypeID, attachmentGUID, t, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class attachmentsGetFileExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new AttachmentsApi();
var attachmentTypeID = 56; // Integer | Attachment type (default to null)
var attachmentGUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Attachment unique identifier (default to null)
var t = true; // Boolean | Token representing the attachment details (default to null)
try {
// Get a file content
stream result = apiInstance.attachmentsGetFile(attachmentTypeID, attachmentGUID, t);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling AttachmentsApi.attachmentsGetFile: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\AttachmentsApi();
$attachmentTypeID = 56; // Integer | Attachment type
$attachmentGUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Attachment unique identifier
$t = true; // Boolean | Token representing the attachment details
try {
$result = $api_instance->attachmentsGetFile($attachmentTypeID, $attachmentGUID, $t);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AttachmentsApi->attachmentsGetFile: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::AttachmentsApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::AttachmentsApi->new();
my $attachmentTypeID = 56; # Integer | Attachment type
my $attachmentGUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Attachment unique identifier
my $t = true; # Boolean | Token representing the attachment details
eval {
my $result = $api_instance->attachmentsGetFile(attachmentTypeID => $attachmentTypeID, attachmentGUID => $attachmentGUID, t => $t);
print Dumper($result);
};
if ($@) {
warn "Exception when calling AttachmentsApi->attachmentsGetFile: $@\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.AttachmentsApi()
attachmentTypeID = 56 # Integer | Attachment type (default to null)
attachmentGUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Attachment unique identifier (default to null)
t = true # Boolean | Token representing the attachment details (default to null)
try:
# Get a file content
api_response = api_instance.attachments_get_file(attachmentTypeID, attachmentGUID, t)
pprint(api_response)
except ApiException as e:
print("Exception when calling AttachmentsApi->attachmentsGetFile: %s\n" % e)
extern crate AttachmentsApi;
pub fn main() {
let attachmentTypeID = 56; // Integer
let attachmentGUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID
let t = true; // Boolean
let mut context = AttachmentsApi::Context::default();
let result = client.attachmentsGetFile(attachmentTypeID, attachmentGUID, t, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
| Name | Description |
|---|---|
| attachmentTypeID* |
Integer
(int32)
Attachment type
Required
|
| attachmentGUID* |
UUID
(uuid)
Attachment unique identifier
Required
|
| Name | Description |
|---|---|
| t* |
Boolean
Token representing the attachment details
Required
|