WS-RESTRICTED_API Host [RESTRICTED_API] : D5290-staging

<back to all web services

url_shortener

URL Shortener
The following routes are available for this service:
GET,POST/url_shortener
"use strict";
export class url_shortenerResponse {
    /** @param {{tiny_url?:string,original_url?:string,created_date?:string,expiry_date?:string,collision?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    tiny_url;
    /** @type {string} */
    original_url;
    /** @type {string} */
    created_date;
    /** @type {?string} */
    expiry_date;
    /** @type {?number} */
    collision;
}
/** @typedef {'0x4E71'|'ShortenUrl'|'GetOriginalUrl'|'RedirectUrl'} */
export var operationType;
(function (operationType) {
    operationType["NoOperation"] = "0x4E71"
    operationType["ShortenUrl"] = "ShortenUrl"
    operationType["GetOriginalUrl"] = "GetOriginalUrl"
    operationType["RedirectUrl"] = "RedirectUrl"
})(operationType || (operationType = {}));
export class url_shortener {
    /** @param {{operation?:operationType,url?:string,days?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {operationType}
     * @description operation type */
    operation;
    /**
     * @type {string}
     * @description url */
    url;
    /**
     * @type {?number}
     * @description days to expire */
    days;
}

JavaScript url_shortener DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /url_shortener HTTP/1.1 
Host: milliet.io 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"operation":"0x4E71","url":"String","days":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"tiny_url":"String","original_url":"String","created_date":"0001-01-01T00:00:00.0000000","expiry_date":"0001-01-01T00:00:00.0000000","collision":0}