Skip to navigation

Create a short URL

Request

This endpoint expects an object.
longUrlstringRequired
The URL that the user should be redirected to. Must be a valid URL.
expDatestringRequired

The date that the shortUrl will expire on. Expired URLs will redirect users to the URL not found page. We generally recommend you pick a expiration date that is twice as long as you expect the URL to be 'useful' for. See these examples. If you are generating one-off links (OTP, safe key, user specific American Express offer, etc.) which will be used in the next three days, then pick a expiration date of one week. Alternatively if you are generating links for a marketing campaign where the campaign is expected to finish one year from now, then give an expiration date of two years.

pathstringOptional

This is to request a specific "vanity" URL. If provided, we will try and register the link on this path. If the path is not available for the requested domain (i.e., it was already taken), the request will return an HTTP 400 error.

domainenumOptionalDefaults to m
This is the domain to be used for the shortURL in E3.
Allowed values:
paramsobjectOptional
This is to provide additional metadata about the URL. It also can be used to set advanced options for the URL, like cache strategy or retention period.
userstringOptional
The ADS ID of an American Express colleague responsible for this URL. This will be used to contact you about your URL.
userGroupstringOptional

This is to provide information about the user submitting the DotAmex registration request; to be referenced for link expiration communication.

Response

Success response.
longUrlstring
The URL that the user should be redirected to. Must be a valid URL.
shortUrlstring

The returned shortUrl will only be "short" in E3, where the m, go, bca.m, t.m DNS records are in place. In E1, the value will begin with empurlshortener-dev.americanexpress.com. In E2, the value will begin with empurlshortener-qa.americanexpress.com.

expDatestring

The date that the shortUrl will expire on. Expired URLs will redirect users to the URL not found page. We generally recommend you pick a expiration date that is twice as long as you expect the URL to be 'useful' for. See these examples. If you are generating one-off links (OTP, safe key, user specific American Express offer, etc.) which will be used in the next three days, then pick a expiration date of one week. Alternatively if you are generating links for a marketing campaign where the campaign is expected to finish one year from now, then give an expiration date of two years.

paramsobjectOptional
This is to provide additional metadata about the URL. It also can be used to set advanced options for the URL, like cache strategy or retention period.

Errors

400
Bad Request Error