Redirects and Vanity URLs for Confluence

Config

getConfig

Returns the current configuration

Returns the root configuration object and the url mappings


/reconfigure/config/admin

Usage and SDK Samples

curl -X GET -H "Authorization: Basic [[basicHash]]" "https://{confluenceHost}{confluenceContextPath}/rest/vanityurl-admin/2.0/reconfigure/config/admin"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ConfigApi;

import java.io.File;
import java.util.*;

public class ConfigApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("YOUR USERNAME");
        basicAuth.setPassword("YOUR PASSWORD");

        // Configure API key authorization: sessionCookie
        ApiKeyAuth sessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("sessionCookie");
        sessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //sessionCookie.setApiKeyPrefix("Token");

        ConfigApi apiInstance = new ConfigApi();
        try {
            rootConfiguration result = apiInstance.getConfig();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConfigApi#getConfig");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ConfigApi;

public class ConfigApiExample {

    public static void main(String[] args) {
        ConfigApi apiInstance = new ConfigApi();
        try {
            rootConfiguration result = apiInstance.getConfig();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConfigApi#getConfig");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Configure API key authorization: (authentication scheme: sessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"JSESSIONID"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"JSESSIONID"];

ConfigApi *apiInstance = [[ConfigApi alloc] init];

// Returns the current configuration
[apiInstance getConfigWithCompletionHandler: 
              ^(rootConfiguration output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RedirectsAndVanityUrLsForConfluence = require('redirects_and_vanity_ur_ls_for_confluence');
var defaultClient = RedirectsAndVanityUrLsForConfluence.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

// Configure API key authorization: sessionCookie
var sessionCookie = defaultClient.authentications['sessionCookie'];
sessionCookie.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//sessionCookie.apiKeyPrefix['JSESSIONID'] = "Token"

var api = new RedirectsAndVanityUrLsForConfluence.ConfigApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getConfig(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getConfigExample
    {
        public void main()
        {
            // Configure HTTP basic authorization: basicAuth
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";
            // Configure API key authorization: sessionCookie
            Configuration.Default.ApiKey.Add("JSESSIONID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("JSESSIONID", "Bearer");

            var apiInstance = new ConfigApi();

            try
            {
                // Returns the current configuration
                rootConfiguration result = apiInstance.getConfig();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ConfigApi.getConfig: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
// Configure API key authorization: sessionCookie
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('JSESSIONID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('JSESSIONID', 'Bearer');

$api_instance = new Swagger\Client\ApiConfigApi();

try {
    $result = $api_instance->getConfig();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConfigApi->getConfig: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ConfigApi;
# Configure HTTP basic authorization: basicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
# Configure API key authorization: sessionCookie
$WWW::SwaggerClient::Configuration::api_key->{'JSESSIONID'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'JSESSIONID'} = "Bearer";

my $api_instance = WWW::SwaggerClient::ConfigApi->new();

eval { 
    my $result = $api_instance->getConfig();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConfigApi->getConfig: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: sessionCookie
swagger_client.configuration.api_key['JSESSIONID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['JSESSIONID'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.ConfigApi()

try: 
    # Returns the current configuration
    api_response = api_instance.get_config()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConfigApi->getConfig: %s\n" % e)

Parameters

Responses

Status: 200 - Config response

Status: default - unexpected error


putConfig

Replaces the current configuration with the given one

Replaces the current configuration in the database with the given one. This is an expensive operation, so only use it for e.g. restoring a backup or similar


/reconfigure/config/admin

Usage and SDK Samples

curl -X PUT -H "Authorization: Basic [[basicHash]]" "https://{confluenceHost}{confluenceContextPath}/rest/vanityurl-admin/2.0/reconfigure/config/admin"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ConfigApi;

import java.io.File;
import java.util.*;

public class ConfigApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("YOUR USERNAME");
        basicAuth.setPassword("YOUR PASSWORD");

        // Configure API key authorization: sessionCookie
        ApiKeyAuth sessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("sessionCookie");
        sessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //sessionCookie.setApiKeyPrefix("Token");

        ConfigApi apiInstance = new ConfigApi();
        RootConfiguration body = ; // RootConfiguration | the new configuration to set in the database
        try {
            rootConfiguration result = apiInstance.putConfig(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConfigApi#putConfig");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ConfigApi;

public class ConfigApiExample {

    public static void main(String[] args) {
        ConfigApi apiInstance = new ConfigApi();
        RootConfiguration body = ; // RootConfiguration | the new configuration to set in the database
        try {
            rootConfiguration result = apiInstance.putConfig(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling ConfigApi#putConfig");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Configure API key authorization: (authentication scheme: sessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"JSESSIONID"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"JSESSIONID"];
RootConfiguration *body = ; // the new configuration to set in the database

ConfigApi *apiInstance = [[ConfigApi alloc] init];

// Replaces the current configuration with the given one
[apiInstance putConfigWith:body
              completionHandler: ^(rootConfiguration output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RedirectsAndVanityUrLsForConfluence = require('redirects_and_vanity_ur_ls_for_confluence');
var defaultClient = RedirectsAndVanityUrLsForConfluence.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

// Configure API key authorization: sessionCookie
var sessionCookie = defaultClient.authentications['sessionCookie'];
sessionCookie.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//sessionCookie.apiKeyPrefix['JSESSIONID'] = "Token"

var api = new RedirectsAndVanityUrLsForConfluence.ConfigApi()
var body = ; // {{RootConfiguration}} the new configuration to set in the database

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.putConfig(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class putConfigExample
    {
        public void main()
        {
            // Configure HTTP basic authorization: basicAuth
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";
            // Configure API key authorization: sessionCookie
            Configuration.Default.ApiKey.Add("JSESSIONID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("JSESSIONID", "Bearer");

            var apiInstance = new ConfigApi();
            var body = new RootConfiguration(); // RootConfiguration | the new configuration to set in the database

            try
            {
                // Replaces the current configuration with the given one
                rootConfiguration result = apiInstance.putConfig(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ConfigApi.putConfig: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
// Configure API key authorization: sessionCookie
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('JSESSIONID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('JSESSIONID', 'Bearer');

$api_instance = new Swagger\Client\ApiConfigApi();
$body = ; // RootConfiguration | the new configuration to set in the database

try {
    $result = $api_instance->putConfig($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConfigApi->putConfig: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ConfigApi;
# Configure HTTP basic authorization: basicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
# Configure API key authorization: sessionCookie
$WWW::SwaggerClient::Configuration::api_key->{'JSESSIONID'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'JSESSIONID'} = "Bearer";

my $api_instance = WWW::SwaggerClient::ConfigApi->new();
my $body = WWW::SwaggerClient::Object::RootConfiguration->new(); # RootConfiguration | the new configuration to set in the database

eval { 
    my $result = $api_instance->putConfig(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling ConfigApi->putConfig: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: sessionCookie
swagger_client.configuration.api_key['JSESSIONID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['JSESSIONID'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.ConfigApi()
body =  # RootConfiguration | the new configuration to set in the database

try: 
    # Replaces the current configuration with the given one
    api_response = api_instance.put_config(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConfigApi->putConfig: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - The new configuration

Status: default - unexpected error


URLMappings

deleteUrlMappingById

Deletes a single URL mapping

Deletes a single URL mapping based on the ID supplied


/urlmappings/{id}

Usage and SDK Samples

curl -X DELETE -H "Authorization: Basic [[basicHash]]" "https://{confluenceHost}{confluenceContextPath}/rest/vanityurl-admin/2.0/urlmappings/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.URLMappingsApi;

import java.io.File;
import java.util.*;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("YOUR USERNAME");
        basicAuth.setPassword("YOUR PASSWORD");

        // Configure API key authorization: sessionCookie
        ApiKeyAuth sessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("sessionCookie");
        sessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //sessionCookie.setApiKeyPrefix("Token");

        URLMappingsApi apiInstance = new URLMappingsApi();
        Integer id = 56; // Integer | ID of URL mapping to delete
        try {
            apiInstance.deleteUrlMappingById(id);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#deleteUrlMappingById");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.URLMappingsApi;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        URLMappingsApi apiInstance = new URLMappingsApi();
        Integer id = 56; // Integer | ID of URL mapping to delete
        try {
            apiInstance.deleteUrlMappingById(id);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#deleteUrlMappingById");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Configure API key authorization: (authentication scheme: sessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"JSESSIONID"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"JSESSIONID"];
Integer *id = 56; // ID of URL mapping to delete

URLMappingsApi *apiInstance = [[URLMappingsApi alloc] init];

// Deletes a single URL mapping
[apiInstance deleteUrlMappingByIdWith:id
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RedirectsAndVanityUrLsForConfluence = require('redirects_and_vanity_ur_ls_for_confluence');
var defaultClient = RedirectsAndVanityUrLsForConfluence.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

// Configure API key authorization: sessionCookie
var sessionCookie = defaultClient.authentications['sessionCookie'];
sessionCookie.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//sessionCookie.apiKeyPrefix['JSESSIONID'] = "Token"

var api = new RedirectsAndVanityUrLsForConfluence.URLMappingsApi()
var id = 56; // {{Integer}} ID of URL mapping to delete

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.deleteUrlMappingById(id, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class deleteUrlMappingByIdExample
    {
        public void main()
        {
            // Configure HTTP basic authorization: basicAuth
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";
            // Configure API key authorization: sessionCookie
            Configuration.Default.ApiKey.Add("JSESSIONID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("JSESSIONID", "Bearer");

            var apiInstance = new URLMappingsApi();
            var id = 56;  // Integer | ID of URL mapping to delete

            try
            {
                // Deletes a single URL mapping
                apiInstance.deleteUrlMappingById(id);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling URLMappingsApi.deleteUrlMappingById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
// Configure API key authorization: sessionCookie
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('JSESSIONID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('JSESSIONID', 'Bearer');

$api_instance = new Swagger\Client\ApiURLMappingsApi();
$id = 56; // Integer | ID of URL mapping to delete

try {
    $api_instance->deleteUrlMappingById($id);
} catch (Exception $e) {
    echo 'Exception when calling URLMappingsApi->deleteUrlMappingById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::URLMappingsApi;
# Configure HTTP basic authorization: basicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
# Configure API key authorization: sessionCookie
$WWW::SwaggerClient::Configuration::api_key->{'JSESSIONID'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'JSESSIONID'} = "Bearer";

my $api_instance = WWW::SwaggerClient::URLMappingsApi->new();
my $id = 56; # Integer | ID of URL mapping to delete

eval { 
    $api_instance->deleteUrlMappingById(id => $id);
};
if ($@) {
    warn "Exception when calling URLMappingsApi->deleteUrlMappingById: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: sessionCookie
swagger_client.configuration.api_key['JSESSIONID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['JSESSIONID'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.URLMappingsApi()
id = 56 # Integer | ID of URL mapping to delete

try: 
    # Deletes a single URL mapping
    api_instance.delete_url_mapping_by_id(id)
except ApiException as e:
    print("Exception when calling URLMappingsApi->deleteUrlMappingById: %s\n" % e)

Parameters

Path parameters
Name Description
id*
Integer (int32)
ID of URL mapping to delete
Required

Responses

Status: 204 - Short URL deleted

Status: default - unexpected error


getUrlMappingById

Returns a single URL mapping

Returns a single URL mapping based on its ID


/urlmappings/{id}

Usage and SDK Samples

curl -X GET -H "Authorization: Basic [[basicHash]]" "https://{confluenceHost}{confluenceContextPath}/rest/vanityurl-admin/2.0/urlmappings/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.URLMappingsApi;

import java.io.File;
import java.util.*;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("YOUR USERNAME");
        basicAuth.setPassword("YOUR PASSWORD");

        // Configure API key authorization: sessionCookie
        ApiKeyAuth sessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("sessionCookie");
        sessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //sessionCookie.setApiKeyPrefix("Token");

        URLMappingsApi apiInstance = new URLMappingsApi();
        Integer id = 56; // Integer | ID of urlMapping to fetch
        try {
            urlMapping result = apiInstance.getUrlMappingById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#getUrlMappingById");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.URLMappingsApi;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        URLMappingsApi apiInstance = new URLMappingsApi();
        Integer id = 56; // Integer | ID of urlMapping to fetch
        try {
            urlMapping result = apiInstance.getUrlMappingById(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#getUrlMappingById");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Configure API key authorization: (authentication scheme: sessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"JSESSIONID"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"JSESSIONID"];
Integer *id = 56; // ID of urlMapping to fetch

URLMappingsApi *apiInstance = [[URLMappingsApi alloc] init];

// Returns a single URL mapping
[apiInstance getUrlMappingByIdWith:id
              completionHandler: ^(urlMapping output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RedirectsAndVanityUrLsForConfluence = require('redirects_and_vanity_ur_ls_for_confluence');
var defaultClient = RedirectsAndVanityUrLsForConfluence.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

// Configure API key authorization: sessionCookie
var sessionCookie = defaultClient.authentications['sessionCookie'];
sessionCookie.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//sessionCookie.apiKeyPrefix['JSESSIONID'] = "Token"

var api = new RedirectsAndVanityUrLsForConfluence.URLMappingsApi()
var id = 56; // {{Integer}} ID of urlMapping to fetch

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getUrlMappingById(id, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getUrlMappingByIdExample
    {
        public void main()
        {
            // Configure HTTP basic authorization: basicAuth
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";
            // Configure API key authorization: sessionCookie
            Configuration.Default.ApiKey.Add("JSESSIONID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("JSESSIONID", "Bearer");

            var apiInstance = new URLMappingsApi();
            var id = 56;  // Integer | ID of urlMapping to fetch

            try
            {
                // Returns a single URL mapping
                urlMapping result = apiInstance.getUrlMappingById(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling URLMappingsApi.getUrlMappingById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
// Configure API key authorization: sessionCookie
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('JSESSIONID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('JSESSIONID', 'Bearer');

$api_instance = new Swagger\Client\ApiURLMappingsApi();
$id = 56; // Integer | ID of urlMapping to fetch

try {
    $result = $api_instance->getUrlMappingById($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling URLMappingsApi->getUrlMappingById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::URLMappingsApi;
# Configure HTTP basic authorization: basicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
# Configure API key authorization: sessionCookie
$WWW::SwaggerClient::Configuration::api_key->{'JSESSIONID'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'JSESSIONID'} = "Bearer";

my $api_instance = WWW::SwaggerClient::URLMappingsApi->new();
my $id = 56; # Integer | ID of urlMapping to fetch

eval { 
    my $result = $api_instance->getUrlMappingById(id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling URLMappingsApi->getUrlMappingById: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: sessionCookie
swagger_client.configuration.api_key['JSESSIONID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['JSESSIONID'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.URLMappingsApi()
id = 56 # Integer | ID of urlMapping to fetch

try: 
    # Returns a single URL mapping
    api_response = api_instance.get_url_mapping_by_id(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling URLMappingsApi->getUrlMappingById: %s\n" % e)

Parameters

Path parameters
Name Description
id*
Integer (int32)
ID of urlMapping to fetch
Required

Responses

Status: 200 - URL mapping response

Status: default - unexpected error


getUrlMappings

Retrieves all or filtered URL mappings

Retrieves all URL mappings. You can also provide filters to only retrieve the matching mappings


/urlmappings

Usage and SDK Samples

curl -X GET -H "Authorization: Basic [[basicHash]]" "https://{confluenceHost}{confluenceContextPath}/rest/vanityurl-admin/2.0/urlmappings?shortUrl=&longUrl="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.URLMappingsApi;

import java.io.File;
import java.util.*;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("YOUR USERNAME");
        basicAuth.setPassword("YOUR PASSWORD");

        // Configure API key authorization: sessionCookie
        ApiKeyAuth sessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("sessionCookie");
        sessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //sessionCookie.setApiKeyPrefix("Token");

        URLMappingsApi apiInstance = new URLMappingsApi();
        String shortUrl = shortUrl_example; // String | Optional, if results should be filtered by shortUrl. Will look for exact matches.
        String longUrl = longUrl_example; // String | Optional, if results should be filtered by longUrl. Will look for exact matches.
        try {
            array[urlMapping] result = apiInstance.getUrlMappings(shortUrl, longUrl);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#getUrlMappings");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.URLMappingsApi;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        URLMappingsApi apiInstance = new URLMappingsApi();
        String shortUrl = shortUrl_example; // String | Optional, if results should be filtered by shortUrl. Will look for exact matches.
        String longUrl = longUrl_example; // String | Optional, if results should be filtered by longUrl. Will look for exact matches.
        try {
            array[urlMapping] result = apiInstance.getUrlMappings(shortUrl, longUrl);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#getUrlMappings");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Configure API key authorization: (authentication scheme: sessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"JSESSIONID"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"JSESSIONID"];
String *shortUrl = shortUrl_example; // Optional, if results should be filtered by shortUrl. Will look for exact matches. (optional)
String *longUrl = longUrl_example; // Optional, if results should be filtered by longUrl. Will look for exact matches. (optional)

URLMappingsApi *apiInstance = [[URLMappingsApi alloc] init];

// Retrieves all or filtered URL mappings
[apiInstance getUrlMappingsWith:shortUrl
    longUrl:longUrl
              completionHandler: ^(array[urlMapping] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RedirectsAndVanityUrLsForConfluence = require('redirects_and_vanity_ur_ls_for_confluence');
var defaultClient = RedirectsAndVanityUrLsForConfluence.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

// Configure API key authorization: sessionCookie
var sessionCookie = defaultClient.authentications['sessionCookie'];
sessionCookie.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//sessionCookie.apiKeyPrefix['JSESSIONID'] = "Token"

var api = new RedirectsAndVanityUrLsForConfluence.URLMappingsApi()
var opts = { 
  'shortUrl': shortUrl_example, // {{String}} Optional, if results should be filtered by shortUrl. Will look for exact matches.
  'longUrl': longUrl_example // {{String}} Optional, if results should be filtered by longUrl. Will look for exact matches.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getUrlMappings(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getUrlMappingsExample
    {
        public void main()
        {
            // Configure HTTP basic authorization: basicAuth
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";
            // Configure API key authorization: sessionCookie
            Configuration.Default.ApiKey.Add("JSESSIONID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("JSESSIONID", "Bearer");

            var apiInstance = new URLMappingsApi();
            var shortUrl = shortUrl_example;  // String | Optional, if results should be filtered by shortUrl. Will look for exact matches. (optional) 
            var longUrl = longUrl_example;  // String | Optional, if results should be filtered by longUrl. Will look for exact matches. (optional) 

            try
            {
                // Retrieves all or filtered URL mappings
                array[urlMapping] result = apiInstance.getUrlMappings(shortUrl, longUrl);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling URLMappingsApi.getUrlMappings: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
// Configure API key authorization: sessionCookie
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('JSESSIONID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('JSESSIONID', 'Bearer');

$api_instance = new Swagger\Client\ApiURLMappingsApi();
$shortUrl = shortUrl_example; // String | Optional, if results should be filtered by shortUrl. Will look for exact matches.
$longUrl = longUrl_example; // String | Optional, if results should be filtered by longUrl. Will look for exact matches.

try {
    $result = $api_instance->getUrlMappings($shortUrl, $longUrl);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling URLMappingsApi->getUrlMappings: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::URLMappingsApi;
# Configure HTTP basic authorization: basicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
# Configure API key authorization: sessionCookie
$WWW::SwaggerClient::Configuration::api_key->{'JSESSIONID'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'JSESSIONID'} = "Bearer";

my $api_instance = WWW::SwaggerClient::URLMappingsApi->new();
my $shortUrl = shortUrl_example; # String | Optional, if results should be filtered by shortUrl. Will look for exact matches.
my $longUrl = longUrl_example; # String | Optional, if results should be filtered by longUrl. Will look for exact matches.

eval { 
    my $result = $api_instance->getUrlMappings(shortUrl => $shortUrl, longUrl => $longUrl);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling URLMappingsApi->getUrlMappings: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: sessionCookie
swagger_client.configuration.api_key['JSESSIONID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['JSESSIONID'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.URLMappingsApi()
shortUrl = shortUrl_example # String | Optional, if results should be filtered by shortUrl. Will look for exact matches. (optional)
longUrl = longUrl_example # String | Optional, if results should be filtered by longUrl. Will look for exact matches. (optional)

try: 
    # Retrieves all or filtered URL mappings
    api_response = api_instance.get_url_mappings(shortUrl=shortUrl, longUrl=longUrl)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling URLMappingsApi->getUrlMappings: %s\n" % e)

Parameters

Query parameters
Name Description
shortUrl
String
Optional, if results should be filtered by shortUrl. Will look for exact matches.
longUrl
String
Optional, if results should be filtered by longUrl. Will look for exact matches.

Responses

Status: 200 - URL mappings response


postUrlMapping

Creates a new URL mapping.

Creates a new URL mapping. Short URL must be unique.


/urlmappings

Usage and SDK Samples

curl -X POST -H "Authorization: Basic [[basicHash]]" "https://{confluenceHost}{confluenceContextPath}/rest/vanityurl-admin/2.0/urlmappings"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.URLMappingsApi;

import java.io.File;
import java.util.*;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("YOUR USERNAME");
        basicAuth.setPassword("YOUR PASSWORD");

        // Configure API key authorization: sessionCookie
        ApiKeyAuth sessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("sessionCookie");
        sessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //sessionCookie.setApiKeyPrefix("Token");

        URLMappingsApi apiInstance = new URLMappingsApi();
        UrlMappingFromUser body = ; // UrlMappingFromUser | New URL mapping to create
        try {
            urlMapping result = apiInstance.postUrlMapping(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#postUrlMapping");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.URLMappingsApi;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        URLMappingsApi apiInstance = new URLMappingsApi();
        UrlMappingFromUser body = ; // UrlMappingFromUser | New URL mapping to create
        try {
            urlMapping result = apiInstance.postUrlMapping(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#postUrlMapping");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Configure API key authorization: (authentication scheme: sessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"JSESSIONID"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"JSESSIONID"];
UrlMappingFromUser *body = ; // New URL mapping to create

URLMappingsApi *apiInstance = [[URLMappingsApi alloc] init];

// Creates a new URL mapping.
[apiInstance postUrlMappingWith:body
              completionHandler: ^(urlMapping output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RedirectsAndVanityUrLsForConfluence = require('redirects_and_vanity_ur_ls_for_confluence');
var defaultClient = RedirectsAndVanityUrLsForConfluence.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

// Configure API key authorization: sessionCookie
var sessionCookie = defaultClient.authentications['sessionCookie'];
sessionCookie.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//sessionCookie.apiKeyPrefix['JSESSIONID'] = "Token"

var api = new RedirectsAndVanityUrLsForConfluence.URLMappingsApi()
var body = ; // {{UrlMappingFromUser}} New URL mapping to create

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.postUrlMapping(body, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class postUrlMappingExample
    {
        public void main()
        {
            // Configure HTTP basic authorization: basicAuth
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";
            // Configure API key authorization: sessionCookie
            Configuration.Default.ApiKey.Add("JSESSIONID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("JSESSIONID", "Bearer");

            var apiInstance = new URLMappingsApi();
            var body = new UrlMappingFromUser(); // UrlMappingFromUser | New URL mapping to create

            try
            {
                // Creates a new URL mapping.
                urlMapping result = apiInstance.postUrlMapping(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling URLMappingsApi.postUrlMapping: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
// Configure API key authorization: sessionCookie
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('JSESSIONID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('JSESSIONID', 'Bearer');

$api_instance = new Swagger\Client\ApiURLMappingsApi();
$body = ; // UrlMappingFromUser | New URL mapping to create

try {
    $result = $api_instance->postUrlMapping($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling URLMappingsApi->postUrlMapping: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::URLMappingsApi;
# Configure HTTP basic authorization: basicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
# Configure API key authorization: sessionCookie
$WWW::SwaggerClient::Configuration::api_key->{'JSESSIONID'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'JSESSIONID'} = "Bearer";

my $api_instance = WWW::SwaggerClient::URLMappingsApi->new();
my $body = WWW::SwaggerClient::Object::UrlMappingFromUser->new(); # UrlMappingFromUser | New URL mapping to create

eval { 
    my $result = $api_instance->postUrlMapping(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling URLMappingsApi->postUrlMapping: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: sessionCookie
swagger_client.configuration.api_key['JSESSIONID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['JSESSIONID'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.URLMappingsApi()
body =  # UrlMappingFromUser | New URL mapping to create

try: 
    # Creates a new URL mapping.
    api_response = api_instance.post_url_mapping(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling URLMappingsApi->postUrlMapping: %s\n" % e)

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - New URL mapping created response

Status: default - unexpected error


putUrlMappingById

Replaces a single URL mapping with the given one

Replaces a single URL mapping based on its ID with the one given in the request.


/urlmappings/{id}

Usage and SDK Samples

curl -X PUT -H "Authorization: Basic [[basicHash]]" "https://{confluenceHost}{confluenceContextPath}/rest/vanityurl-admin/2.0/urlmappings/{id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.URLMappingsApi;

import java.io.File;
import java.util.*;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure HTTP basic authorization: basicAuth
        HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
        basicAuth.setUsername("YOUR USERNAME");
        basicAuth.setPassword("YOUR PASSWORD");

        // Configure API key authorization: sessionCookie
        ApiKeyAuth sessionCookie = (ApiKeyAuth) defaultClient.getAuthentication("sessionCookie");
        sessionCookie.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //sessionCookie.setApiKeyPrefix("Token");

        URLMappingsApi apiInstance = new URLMappingsApi();
        UrlMappingFromUser body = ; // UrlMappingFromUser | URL mapping to replace the existing one with
        Integer id = 56; // Integer | ID of urlMapping to fetch
        try {
            urlMapping result = apiInstance.putUrlMappingById(body, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#putUrlMappingById");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.URLMappingsApi;

public class URLMappingsApiExample {

    public static void main(String[] args) {
        URLMappingsApi apiInstance = new URLMappingsApi();
        UrlMappingFromUser body = ; // UrlMappingFromUser | URL mapping to replace the existing one with
        Integer id = 56; // Integer | ID of urlMapping to fetch
        try {
            urlMapping result = apiInstance.putUrlMappingById(body, id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling URLMappingsApi#putUrlMappingById");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure HTTP basic authorization (authentication scheme: basicAuth)
[apiConfig setUsername:@"YOUR_USERNAME"];
[apiConfig setPassword:@"YOUR_PASSWORD"];
// Configure API key authorization: (authentication scheme: sessionCookie)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"JSESSIONID"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"JSESSIONID"];
UrlMappingFromUser *body = ; // URL mapping to replace the existing one with
Integer *id = 56; // ID of urlMapping to fetch

URLMappingsApi *apiInstance = [[URLMappingsApi alloc] init];

// Replaces a single URL mapping with the given one
[apiInstance putUrlMappingByIdWith:body
    id:id
              completionHandler: ^(urlMapping output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var RedirectsAndVanityUrLsForConfluence = require('redirects_and_vanity_ur_ls_for_confluence');
var defaultClient = RedirectsAndVanityUrLsForConfluence.ApiClient.instance;
// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME'
basicAuth.password = 'YOUR PASSWORD'

// Configure API key authorization: sessionCookie
var sessionCookie = defaultClient.authentications['sessionCookie'];
sessionCookie.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//sessionCookie.apiKeyPrefix['JSESSIONID'] = "Token"

var api = new RedirectsAndVanityUrLsForConfluence.URLMappingsApi()
var body = ; // {{UrlMappingFromUser}} URL mapping to replace the existing one with
var id = 56; // {{Integer}} ID of urlMapping to fetch

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.putUrlMappingById(bodyid, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class putUrlMappingByIdExample
    {
        public void main()
        {
            // Configure HTTP basic authorization: basicAuth
            Configuration.Default.Username = "YOUR_USERNAME";
            Configuration.Default.Password = "YOUR_PASSWORD";
            // Configure API key authorization: sessionCookie
            Configuration.Default.ApiKey.Add("JSESSIONID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("JSESSIONID", "Bearer");

            var apiInstance = new URLMappingsApi();
            var body = new UrlMappingFromUser(); // UrlMappingFromUser | URL mapping to replace the existing one with
            var id = 56;  // Integer | ID of urlMapping to fetch

            try
            {
                // Replaces a single URL mapping with the given one
                urlMapping result = apiInstance.putUrlMappingById(body, id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling URLMappingsApi.putUrlMappingById: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Swagger\Client\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Swagger\Client\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
// Configure API key authorization: sessionCookie
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('JSESSIONID', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('JSESSIONID', 'Bearer');

$api_instance = new Swagger\Client\ApiURLMappingsApi();
$body = ; // UrlMappingFromUser | URL mapping to replace the existing one with
$id = 56; // Integer | ID of urlMapping to fetch

try {
    $result = $api_instance->putUrlMappingById($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling URLMappingsApi->putUrlMappingById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::URLMappingsApi;
# Configure HTTP basic authorization: basicAuth
$WWW::SwaggerClient::Configuration::username = 'YOUR_USERNAME';
$WWW::SwaggerClient::Configuration::password = 'YOUR_PASSWORD';
# Configure API key authorization: sessionCookie
$WWW::SwaggerClient::Configuration::api_key->{'JSESSIONID'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'JSESSIONID'} = "Bearer";

my $api_instance = WWW::SwaggerClient::URLMappingsApi->new();
my $body = WWW::SwaggerClient::Object::UrlMappingFromUser->new(); # UrlMappingFromUser | URL mapping to replace the existing one with
my $id = 56; # Integer | ID of urlMapping to fetch

eval { 
    my $result = $api_instance->putUrlMappingById(body => $body, id => $id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling URLMappingsApi->putUrlMappingById: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basicAuth
swagger_client.configuration.username = 'YOUR_USERNAME'
swagger_client.configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: sessionCookie
swagger_client.configuration.api_key['JSESSIONID'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['JSESSIONID'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.URLMappingsApi()
body =  # UrlMappingFromUser | URL mapping to replace the existing one with
id = 56 # Integer | ID of urlMapping to fetch

try: 
    # Replaces a single URL mapping with the given one
    api_response = api_instance.put_url_mapping_by_id(body, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling URLMappingsApi->putUrlMappingById: %s\n" % e)

Parameters

Path parameters
Name Description
id*
Integer (int32)
ID of urlMapping to fetch
Required
Body parameters
Name Description
body *

Responses

Status: 200 - URL mapping response

Status: default - unexpected error