Integration Made Easy.

Not Safe For Work ™ uses a RESTful approach to providing access URL creation.

Creating a Link

The URL for creating a link is http://nsfw4.me/links/create

To create a link using this URL, simply use an HTTP-POST using these keys:

Result Formatting

A standard HTTP-POST to that URL will result in a the system rendering an HTML page with the appropriate results. This is appropriate for web interaction, but for integrating with your application, you will probably want to choose something like XML or JSON.

XML

To receive the results of your request as an XML document, simply append ".xml" to your HTTP-POST request.

The URL for creating a link and receiving xml in return is http://nsfw4.me/links/create.xml

Output Example - Success

<?xml version="1.0" ?>
<linkcreationresult>
  <FullLink>http://nsfw4.me/pFz</FullLink>
  <DestinationUrl>http://somelink.com</DestinationUrl>
  <Impressions>0</Impressions>
  <Views>0</Views>
  <AverageRating>0</AverageRating>
  <NumberOfRatings>0</NumberOfRatings>
  <Link>/pFz</Link>
  <DateCreated>0001-01-01T00:00:00</DateCreated>
  <Message>Link Created Successfully</Message>
  <Error>false</Error>
</linkcreationresult>

 

Output Example - Failure

<?xml version="1.0" ?>
<linkcreationresult>
  <DestinationUrl>http://somelink.com</DestinationUrl>
  <Impressions>0</Impressions>
  <Views>0</Views>
  <AverageRating>0</AverageRating>
  <NumberOfRatings>0</NumberOfRatings>
  <Link>/pFz</Link>
  <DateCreated>0001-01-01T00:00:00</DateCreated>
  <Message>Unable to create that link</Message>
  <Errors>
    <string>That link id (the short one) is already in use</string>
  </Errors>
  <Error>true</Error>
</linkcreationresult>

JSON

To receive the results of your request as JSON, simply append ".json" to your HTTP-POST request. .json" to your HTTP-POST request.

The URL for creating a link and receiving xml in return is http://nsfw4.me/links/create.json

Output Example - Success

{ "Message": "Link Created Successfully", "Errors": null, "Error": false, "FullLink": "http://nsfw4.me/iiM", "DestinationUrl": "http://somelink.com", "Impressions": 0, "Views": 0, "AverageRating": 0, "NumberOfRatings": 0, "Link": "/iiM", "DateCreated": "\/Date(-62135571600000-0700)\/" }

Output Example - Failure

{ "Message": "Unable to create that link", "Errors": [ "That link id (the short one) is already in use" ], "Error": true, "FullLink": null, "DestinationUrl": "http://somelink.com", "Impressions": 0, "Views": 0, "AverageRating": 0, "NumberOfRatings": 0, "Link": "/iiM", "DateCreated": "\/Date(-62135571600000-0700)\/" }

NSFW4 Shorten

Drag this bookmarklet to your favorites bar to allow creation of NSFW Links from anywhere