doUploadMultipartMedia
Uploads media.
Provides a new multipart media item for a given catalogId.
/v1/catalogs/{catalogId}/versions/{versionId}/media
Usage and SDK Samples
curl -X POST\
\
\
-H "Accept: application/xml,application/json"\
-H "Content-Type: application/json"\
"http://localhost:9001/cmswebservices/v1/catalogs/{catalogId}/versions/{versionId}/media?altText=&code=&description=&folder=&mime="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CatalogVersionMediaApi;
import java.io.File;
import java.util.*;
public class CatalogVersionMediaApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: oauth2_Password
OAuth oauth2_Password = (OAuth) defaultClient.getAuthentication("oauth2_Password");
oauth2_Password.setAccessToken("YOUR ACCESS TOKEN");
// Configure OAuth2 access token for authorization: oauth2_client_credentials
OAuth oauth2_client_credentials = (OAuth) defaultClient.getAuthentication("oauth2_client_credentials");
oauth2_client_credentials.setAccessToken("YOUR ACCESS TOKEN");
CatalogVersionMediaApi apiInstance = new CatalogVersionMediaApi();
String altText = altText_example; // String | The alternative text to use for the newly created media.
String code = code_example; // String | The code to use for the newly created media.
String description = description_example; // String | The description to use for the newly created media.
String folder = folder_example; // String | The folder that media will be update to
String catalogId = catalogId_example; // String | The unique identifier of the catalog for which to link the new media.
String versionId = versionId_example; // String | The specific catalog version to which the new media will be associated to.
VersionId_media_body body = ; // VersionId_media_body |
String mime = mime_example; // String | Internet Media Type for the media file.
try {
MediaData result = apiInstance.doUploadMultipartMedia(altText, code, description, folder, catalogId, versionId, body, mime);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CatalogVersionMediaApi#doUploadMultipartMedia");
e.printStackTrace();
}
}
}
import io.swagger.client.api.CatalogVersionMediaApi;
public class CatalogVersionMediaApiExample {
public static void main(String[] args) {
CatalogVersionMediaApi apiInstance = new CatalogVersionMediaApi();
String altText = altText_example; // String | The alternative text to use for the newly created media.
String code = code_example; // String | The code to use for the newly created media.
String description = description_example; // String | The description to use for the newly created media.
String folder = folder_example; // String | The folder that media will be update to
String catalogId = catalogId_example; // String | The unique identifier of the catalog for which to link the new media.
String versionId = versionId_example; // String | The specific catalog version to which the new media will be associated to.
VersionId_media_body body = ; // VersionId_media_body |
String mime = mime_example; // String | Internet Media Type for the media file.
try {
MediaData result = apiInstance.doUploadMultipartMedia(altText, code, description, folder, catalogId, versionId, body, mime);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CatalogVersionMediaApi#doUploadMultipartMedia");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure OAuth2 access token for authorization: (authentication scheme: oauth2_Password)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
// Configure OAuth2 access token for authorization: (authentication scheme: oauth2_client_credentials)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
String *altText = altText_example; // The alternative text to use for the newly created media.
String *code = code_example; // The code to use for the newly created media.
String *description = description_example; // The description to use for the newly created media.
String *folder = folder_example; // The folder that media will be update to
String *catalogId = catalogId_example; // The unique identifier of the catalog for which to link the new media.
String *versionId = versionId_example; // The specific catalog version to which the new media will be associated to.
VersionId_media_body *body = ; // (optional)
String *mime = mime_example; // Internet Media Type for the media file. (optional)
CatalogVersionMediaApi *apiInstance = [[CatalogVersionMediaApi alloc] init];
// Uploads media.
[apiInstance doUploadMultipartMediaWith:altText
code:code
description:description
folder:folder
catalogId:catalogId
versionId:versionId
body:body
mime:mime
completionHandler: ^(MediaData output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var CmsWebservices = require('cms_webservices');
var defaultClient = CmsWebservices.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2_Password
var oauth2_Password = defaultClient.authentications['oauth2_Password'];
oauth2_Password.accessToken = "YOUR ACCESS TOKEN"
// Configure OAuth2 access token for authorization: oauth2_client_credentials
var oauth2_client_credentials = defaultClient.authentications['oauth2_client_credentials'];
oauth2_client_credentials.accessToken = "YOUR ACCESS TOKEN"
var api = new CmsWebservices.CatalogVersionMediaApi()
var altText = altText_example; // {{String}} The alternative text to use for the newly created media.
var code = code_example; // {{String}} The code to use for the newly created media.
var description = description_example; // {{String}} The description to use for the newly created media.
var folder = folder_example; // {{String}} The folder that media will be update to
var catalogId = catalogId_example; // {{String}} The unique identifier of the catalog for which to link the new media.
var versionId = versionId_example; // {{String}} The specific catalog version to which the new media will be associated to.
var opts = {
'body': // {{VersionId_media_body}}
'mime': mime_example // {{String}} Internet Media Type for the media file.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.doUploadMultipartMedia(altTextcodedescriptionfoldercatalogIdversionId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class doUploadMultipartMediaExample
{
public void main()
{
// Configure OAuth2 access token for authorization: oauth2_Password
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
// Configure OAuth2 access token for authorization: oauth2_client_credentials
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new CatalogVersionMediaApi();
var altText = altText_example; // String | The alternative text to use for the newly created media.
var code = code_example; // String | The code to use for the newly created media.
var description = description_example; // String | The description to use for the newly created media.
var folder = folder_example; // String | The folder that media will be update to
var catalogId = catalogId_example; // String | The unique identifier of the catalog for which to link the new media.
var versionId = versionId_example; // String | The specific catalog version to which the new media will be associated to.
var body = new VersionId_media_body(); // VersionId_media_body | (optional)
var mime = mime_example; // String | Internet Media Type for the media file. (optional)
try
{
// Uploads media.
MediaData result = apiInstance.doUploadMultipartMedia(altText, code, description, folder, catalogId, versionId, body, mime);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling CatalogVersionMediaApi.doUploadMultipartMedia: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2_Password
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
// Configure OAuth2 access token for authorization: oauth2_client_credentials
Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$api_instance = new Swagger\Client\ApiCatalogVersionMediaApi();
$altText = altText_example; // String | The alternative text to use for the newly created media.
$code = code_example; // String | The code to use for the newly created media.
$description = description_example; // String | The description to use for the newly created media.
$folder = folder_example; // String | The folder that media will be update to
$catalogId = catalogId_example; // String | The unique identifier of the catalog for which to link the new media.
$versionId = versionId_example; // String | The specific catalog version to which the new media will be associated to.
$body = ; // VersionId_media_body |
$mime = mime_example; // String | Internet Media Type for the media file.
try {
$result = $api_instance->doUploadMultipartMedia($altText, $code, $description, $folder, $catalogId, $versionId, $body, $mime);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CatalogVersionMediaApi->doUploadMultipartMedia: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CatalogVersionMediaApi;
# Configure OAuth2 access token for authorization: oauth2_Password
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
# Configure OAuth2 access token for authorization: oauth2_client_credentials
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::CatalogVersionMediaApi->new();
my $altText = altText_example; # String | The alternative text to use for the newly created media.
my $code = code_example; # String | The code to use for the newly created media.
my $description = description_example; # String | The description to use for the newly created media.
my $folder = folder_example; # String | The folder that media will be update to
my $catalogId = catalogId_example; # String | The unique identifier of the catalog for which to link the new media.
my $versionId = versionId_example; # String | The specific catalog version to which the new media will be associated to.
my $body = WWW::SwaggerClient::Object::VersionId_media_body->new(); # VersionId_media_body |
my $mime = mime_example; # String | Internet Media Type for the media file.
eval {
my $result = $api_instance->doUploadMultipartMedia(altText => $altText, code => $code, description => $description, folder => $folder, catalogId => $catalogId, versionId => $versionId, body => $body, mime => $mime);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CatalogVersionMediaApi->doUploadMultipartMedia: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure OAuth2 access token for authorization: oauth2_Password
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Configure OAuth2 access token for authorization: oauth2_client_credentials
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
# create an instance of the API class
api_instance = swagger_client.CatalogVersionMediaApi()
altText = altText_example # String | The alternative text to use for the newly created media.
code = code_example # String | The code to use for the newly created media.
description = description_example # String | The description to use for the newly created media.
folder = folder_example # String | The folder that media will be update to
catalogId = catalogId_example # String | The unique identifier of the catalog for which to link the new media.
versionId = versionId_example # String | The specific catalog version to which the new media will be associated to.
body = # VersionId_media_body | (optional)
mime = mime_example # String | Internet Media Type for the media file. (optional)
try:
# Uploads media.
api_response = api_instance.do_upload_multipart_media(altText, code, description, folder, catalogId, versionId, body=body, mime=mime)
pprint(api_response)
except ApiException as e:
print("Exception when calling CatalogVersionMediaApi->doUploadMultipartMedia: %s\n" % e)
Parameters
| Name | Description |
|---|---|
| catalogId* |
String
The unique identifier of the catalog for which to link the new media.
Required
|
| versionId* |
String
The specific catalog version to which the new media will be associated to.
Required
|
| Name | Description |
|---|---|
| body |
| Name | Description |
|---|---|
| altText* |
String
The alternative text to use for the newly created media.
Required
|
| code* |
String
The code to use for the newly created media.
Required
|
| description* |
String
The description to use for the newly created media.
Required
|
| folder* |
String
The folder that media will be update to
Required
|
| mime |
String
Internet Media Type for the media file.
|