POST

Creates a shortened URL.

Based on the type of shortURL created, there are different required fields: generic shortURLs require only url; chat_invite shortURLs require url, campaignRefURL and scRefURL.

URL:

https://<ServerIP>:<Port>/ccp-webapp/ccp/shorturl/

HTTPS method:

POST

Parameters:

Type: optional. The shortURL type. Valid values are generic (the default) and chat_invite.

URL: required. The URL being shortened (required).

campaignRefURL: required for chat_invite type. The refURL of the campaign for which this short URL is being created.

scRefURL: required for chat_invite type. The refURL of the inviting social contact.

active: optional. For the chat_invite type, active means that the shortURL was successfully sent with the reply as a chat invitation. Valid values are false (the default) or true.

expireDate: optional. The expiration date of the shortened URL. Defaults to 24 hours from creation. Expiration may be no more than 30 days in the future.

Example XML request payload:


 <ShortURL>
  <type>chat_invite</type>
  <url>http://theurl.com?param1=val1</url>
  <campaignRefURL>https://[ServerIP]:[Port]/ccp-webapp/ccp/campaign/
   [public ID]</campaignRefURL>
  <scRefURL>https://[ServerIP]:[Port]/ccp-webapp/ccp/socialcontact/
   [SC ID]</scRefURL>
  <expireDate>[timestamp]</expireDate>
</ShortURL>

Or, for a generic shortURL:


 <ShortURL>
  <url>http://theurl.com?param1=val1</url>
 </ShortURL>

Note

When using a full url with multiple parameters, special characters must be properly escaped. This means, for example, that characters such as "&" should appear inside the xml body as "&amp;".

HTTPS response headers:

If successful, the location field in the http response header will have a URL to the newly created short URL. A GET of the newly created short URL will provide the shortened URL.

See API Conventions for error information.