getGeneratedPhotoOfferId
Returns an image based on the exact offer ID and sizes.
/photocombinations/offers/{offer_id}/generations/{generation_id}
Usage and SDK Samples
curl -X GET\
-H "X-API-Key: [[apiKey]]"\
-H "Accept: image/png,application/json"\
"https://imageservice2.republica.dk//photocombinations/offers/{offer_id}/generations/{generation_id}"
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) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: APIKeyHeader
ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
APIKeyHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.setApiKeyPrefix("Token");
DefaultApi apiInstance = new DefaultApi();
String offerId = offerId_example; // String |
String generationId = generationId_example; // String |
try {
byte[] result = apiInstance.getGeneratedPhotoOfferId(offerId, generationId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getGeneratedPhotoOfferId");
e.printStackTrace();
}
}
}
import io.swagger.client.api.DefaultApi;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String offerId = offerId_example; // String |
String generationId = generationId_example; // String |
try {
byte[] result = apiInstance.getGeneratedPhotoOfferId(offerId, generationId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#getGeneratedPhotoOfferId");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-API-Key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-API-Key"];
String *offerId = offerId_example; //
String *generationId = generationId_example; //
DefaultApi *apiInstance = [[DefaultApi alloc] init];
[apiInstance getGeneratedPhotoOfferIdWith:offerId
generationId:generationId
completionHandler: ^(byte[] output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var RepublicaImageApi = require('republica_image_api');
var defaultClient = RepublicaImageApi.ApiClient.instance;
// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['X-API-Key'] = "Token"
var api = new RepublicaImageApi.DefaultApi()
var offerId = offerId_example; // {{String}}
var generationId = generationId_example; // {{String}}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getGeneratedPhotoOfferId(offerId, generationId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getGeneratedPhotoOfferIdExample
{
public void main()
{
// Configure API key authorization: APIKeyHeader
Configuration.Default.ApiKey.Add("X-API-Key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("X-API-Key", "Bearer");
var apiInstance = new DefaultApi();
var offerId = offerId_example; // String |
var generationId = generationId_example; // String |
try
{
byte[] result = apiInstance.getGeneratedPhotoOfferId(offerId, generationId);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DefaultApi.getGeneratedPhotoOfferId: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-Key', 'Bearer');
$api_instance = new Swagger\Client\ApiDefaultApi();
$offerId = offerId_example; // String |
$generationId = generationId_example; // String |
try {
$result = $api_instance->getGeneratedPhotoOfferId($offerId, $generationId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getGeneratedPhotoOfferId: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;
# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'X-API-Key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'X-API-Key'} = "Bearer";
my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $offerId = offerId_example; # String |
my $generationId = generationId_example; # String |
eval {
my $result = $api_instance->getGeneratedPhotoOfferId(offerId => $offerId, generationId => $generationId);
print Dumper($result);
};
if ($@) {
warn "Exception when calling DefaultApi->getGeneratedPhotoOfferId: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.DefaultApi()
offerId = offerId_example # String |
generationId = generationId_example # String |
try:
api_response = api_instance.get_generated_photo_offer_id(offerId, generationId)
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->getGeneratedPhotoOfferId: %s\n" % e)
Parameters
Name | Description |
---|---|
offer_id* |
String
Required
|
generation_id* |
String
Required
|
Responses
Status: 200 - Image data ready for use with correct Content-Type headers.
Status: 400 - The parameters are not correct. offer_id and generation_id have to be valid.
Status: 500 - Something went wrong internally. The issue has been logged.
Name | Type | Format | Description |
---|---|---|---|
X-Error | String |