addAttachments
Add an attachment to a job
Add an attachment to a job to provide additional or support information related to the job. The **jobUpdateAttachments** privilege is required to add an attachment to a job.
/workflow/{itemId}/jobs/{jobId}/attachments
Usage and SDK Samples
curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: multipart/form-data"\
"http://localhost/workflow/{itemId}/jobs/{jobId}/attachments"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.JobsApi;
import java.io.File;
import java.util.*;
public class JobsApiExample {
public static void main(String[] args) {
// Create an instance of the API class
JobsApi apiInstance = new JobsApi();
String jobId = jobId_example; // String |
String itemId = itemId_example; // String |
String token = token_example; // String |
File attachment = BINARY_DATA_HERE; // File | The file to be uploaded and attached to the job.
String alias = alias_example; // String | Display name for the attachment.
String folder = folder_example; // String | Folder under which the attachment will be stored.
try {
inline_response_200_13 result = apiInstance.addAttachments(jobId, itemId, token, attachment, alias, folder);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling JobsApi#addAttachments");
e.printStackTrace();
}
}
}
import org.openapitools.client.api.JobsApi;
public class JobsApiExample {
public static void main(String[] args) {
JobsApi apiInstance = new JobsApi();
String jobId = jobId_example; // String |
String itemId = itemId_example; // String |
String token = token_example; // String |
File attachment = BINARY_DATA_HERE; // File | The file to be uploaded and attached to the job.
String alias = alias_example; // String | Display name for the attachment.
String folder = folder_example; // String | Folder under which the attachment will be stored.
try {
inline_response_200_13 result = apiInstance.addAttachments(jobId, itemId, token, attachment, alias, folder);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling JobsApi#addAttachments");
e.printStackTrace();
}
}
}
// Create an instance of the API class
JobsApi *apiInstance = [[JobsApi alloc] init];
String *jobId = jobId_example; // (default to null)
String *itemId = itemId_example; // (default to null)
String *token = token_example; // (default to null)
File *attachment = BINARY_DATA_HERE; // The file to be uploaded and attached to the job. (default to null)
String *alias = alias_example; // Display name for the attachment. (optional) (default to null)
String *folder = folder_example; // Folder under which the attachment will be stored. (optional) (default to null)
// Add an attachment to a job
[apiInstance addAttachmentsWith:jobId
itemId:itemId
token:token
attachment:attachment
alias:alias
folder:folder
completionHandler: ^(inline_response_200_13 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var WorkflowManagerApi = require('workflow_manager_api');
// Create an instance of the API class
var api = new WorkflowManagerApi.JobsApi()
var jobId = jobId_example; // {String}
var itemId = itemId_example; // {String}
var token = token_example; // {String}
var attachment = BINARY_DATA_HERE; // {File} The file to be uploaded and attached to the job.
var opts = {
'alias': alias_example, // {String} Display name for the attachment.
'folder': folder_example // {String} Folder under which the attachment will be stored.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.addAttachments(jobId, itemId, token, attachment, opts, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class addAttachmentsExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new JobsApi();
var jobId = jobId_example; // String | (default to null)
var itemId = itemId_example; // String | (default to null)
var token = token_example; // String | (default to null)
var attachment = BINARY_DATA_HERE; // File | The file to be uploaded and attached to the job. (default to null)
var alias = alias_example; // String | Display name for the attachment. (optional) (default to null)
var folder = folder_example; // String | Folder under which the attachment will be stored. (optional) (default to null)
try {
// Add an attachment to a job
inline_response_200_13 result = apiInstance.addAttachments(jobId, itemId, token, attachment, alias, folder);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling JobsApi.addAttachments: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\JobsApi();
$jobId = jobId_example; // String |
$itemId = itemId_example; // String |
$token = token_example; // String |
$attachment = BINARY_DATA_HERE; // File | The file to be uploaded and attached to the job.
$alias = alias_example; // String | Display name for the attachment.
$folder = folder_example; // String | Folder under which the attachment will be stored.
try {
$result = $api_instance->addAttachments($jobId, $itemId, $token, $attachment, $alias, $folder);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling JobsApi->addAttachments: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::JobsApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::JobsApi->new();
my $jobId = jobId_example; # String |
my $itemId = itemId_example; # String |
my $token = token_example; # String |
my $attachment = BINARY_DATA_HERE; # File | The file to be uploaded and attached to the job.
my $alias = alias_example; # String | Display name for the attachment.
my $folder = folder_example; # String | Folder under which the attachment will be stored.
eval {
my $result = $api_instance->addAttachments(jobId => $jobId, itemId => $itemId, token => $token, attachment => $attachment, alias => $alias, folder => $folder);
print Dumper($result);
};
if ($@) {
warn "Exception when calling JobsApi->addAttachments: $@\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.JobsApi()
jobId = jobId_example # String | (default to null)
itemId = itemId_example # String | (default to null)
token = token_example # String | (default to null)
attachment = BINARY_DATA_HERE # File | The file to be uploaded and attached to the job. (default to null)
alias = alias_example # String | Display name for the attachment. (optional) (default to null)
folder = folder_example # String | Folder under which the attachment will be stored. (optional) (default to null)
try:
# Add an attachment to a job
api_response = api_instance.add_attachments(jobId, itemId, token, attachment, alias=alias, folder=folder)
pprint(api_response)
except ApiException as e:
print("Exception when calling JobsApi->addAttachments: %s\n" % e)
extern crate JobsApi;
pub fn main() {
let jobId = jobId_example; // String
let itemId = itemId_example; // String
let token = token_example; // String
let attachment = BINARY_DATA_HERE; // File
let alias = alias_example; // String
let folder = folder_example; // String
let mut context = JobsApi::Context::default();
let result = client.addAttachments(jobId, itemId, token, attachment, alias, folder, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
jobId* |
String
Required
|
itemId* |
String
Required
|
Name | Description |
---|---|
token* |
String
Required
|
attachment* |
File
(binary)
The file to be uploaded and attached to the job.
Required
|
alias |
String
Display name for the attachment.
|
folder |
String
Folder under which the attachment will be stored.
|