Tools Blog Learn Quizzes Smile API Log In / Sign Up
Tools Blog Learn Quizzes Smile API Log In / Sign Up
We have updated our privacy policy to let you know that we use cookies to personalise content and ads. We also use cookies to analyse our traffic and we share information about your use of our site and application with our advertising and analytics partners. By using this website or our application you agree to our use of cookies. Learn more about the way this website uses cookies or remove this message.

Codepunker API Docs

Clone on Github GitHub Build Passed
Getting Started :: ServIt :: Uglify Tool :: URL Shortener :: Sitemap Generator :: String Converter

End Point

By default all requests should be sent to: https://www.codepunker.com/tools

Authorization

If you want to access one of the API end points I manage you'll need a valid API key. To generate one, register or . You'll find your API key in the profile menu after you've authenticated.

Token Generation

Once you've got a valid API key, you have to generate a token which will be used to authenticate you for future requests. Tokens are only valid for 24 hours. To generate the token send a POST request with the parameters below:

                
                    execute [type]: string [value]:authorizeAPI
                    key [type]: string [value]:YOUR_API_KEY
                    rand [type]: string [value]: a random 32 characters long alphanumeric string1
                    ----------
                    RESPONSE EXAMPLE:
                    {"type":"success", "response":"i_am_a_32_characters_token"} or 
                    {"type":"error", "response":"i_am_an_error_message"}
                    ----------
                    1 [The random string is required for tasks that use a callback URL]
                
            

API End Points:

  • ServIt

    Description: Serv.It is a CDN created especially for developers and webmasters. Serv.It allows web creators to use a CDN for their static assets (CSS and JavaScript files)

    Usage:

            
                Send a POST request with the following parameters:
                    1: "urlcode" [array] (an array of valid CSS/JS URLs**)
                    2: "execute" [string] (value: executeCDN)
                    3: "token" [string] (the apiToken you generated at step1)
            
        

  • UglifyIt

    Description: Uglifies/minifies your JavaScript and CSS code. Compiles LESS and SASS into CSS and minifies it. Optionally pushes the code to the servIt CDN.

    Usage:

            
                Send a POST request with the following parameters:
                    1: "urlcode" [array] (an array of valid URLs**)
                            OR
                       "pastedcode" [string] (the JavaScript/CSS/LESS/SASS code)
                    2: "language" [string] (values: JavaScript/CSS/LESS/SASS 1)
                    3: "pushtocdn" [string] (values: true / false) /* optional, defaults to false */
                    4: "execute" [string] (value: executeUglify)
                    5: "token" [string] (the apiToken you generated at step1)
                    -----------
                    1[langauge name is case sensitive]
                    2[If your css pre-processor has dependencies from other files make sure you URLs are ordered correctly]
            
        

  • URL Shortener

    Description: Create shortened links that are NEVER tracked.

    Usage:

            
                Send a POST request with the following parameters:
                        1: "urlcode" [string] (a valid url) - required
                        2. "method" [string] ("serverside" or "clientside") - optional
                        3. "valid" [string] ("permanent" or "temporary1") - optional
                        4. "execute" [string] (value: executeShortener) - required
                        5: "token" [string] (the apiToken you generated at step1)
                    -----------
                    1[Temporary links are automatically deleted after a week]
            
        

  • SiteMap Generator

    Description: Crawls your website pages and generates an XML Sitemap containing all your internal links.

    Usage:

            
                --- STEP 1 ---
                    * REQUEST PARAMS: 
                        1. "execute" [type]: string [value]:executeSitemapGenerator
                        2. "domain" [type]: string [value]: the domain for which you want to generate the sitemap
                        3. "freq" [type]:string [value]: valid frequency keywords are: always, 'hourly', 'daily', 'weekly', 'monthly', 'yearly' or 'never'
                        4. "token" [type]: string [value]: the token you received as a response after the first request
                        5. "callbackuri" [type]: string [value]: a valid url that I should notify that the sitemap is ready for download
                        ----------
                        RESPONSE EXAMPLE:
                        [example]: {"type":"success", "response":"the current status of your request"} or {"type":"error", "response":"an error message"}
                --- STEP 2 ---
                    * Your callback url should be able to receive a request from "codepunker.com" once the site-map generation is done. Codepunker.com will send the following json encoded string through a POST request to http://example.com/yourcallback.php
                        1. "data" [type]: string [value]: 
                                {"type": "success", "response": "https://www.codepunker.com/the_url_from_which_you_can_get_your_sitemap"} or
                                {"type":"error", "response":"an error message"}
                        2. rand [type]: string [value]: 
                                the random 32 characters alphanumeric string you sent in your first request will be sent back to you to confirm that the request is a valid one.
            
        

  • String Converter

    Description: Convert, encode and hash strings to almost anything you can think of.

    Usage:

            
                Send a POST request with the following parameters:
                    1: "string"  [string] (the string you are trying to work with) - required
                    2. "method"  [string] ("encode", "decode" or "hash1") - required
                    3: "token" [string] (the apiToken you generated at step1)
                    4. "execute" [string] (value: executeStringConversion) - required
                    ------
                    1 Full list of hashing algorithms: ["md2", "md4", "md5", - "sha1", "sha256", "sha384", "sha512", - "ripemd128", "ripemd160", "ripemd256", "ripemd320", - "whirlpool", - "tiger128,3", "tiger160,3", "tiger192,3", "tiger128,4", "tiger160,4", "tiger192,4", - "snefru", - "gost", - "adler32", - "crc32", "crc32b", - "haval128,3", "haval160,3", "haval192,3", "haval224,3", "haval256,3", "haval128,4", "haval160,4", "haval192,4", "haval224,4", "haval256,4", "haval128,5", "haval160,5", "haval192,5", "haval224,5", "haval256,5"]
            
        


Alerts

2017-02-16 - The bcpowmod function in ext/bcmath/bcmath.c in PHP before 5.5.35, 5.6.x before 5.6.21, and 7.x before 7.0.6 modifies certain data structures without considering whether they are copies of the _zero_, _one_, or _two_ global variable, which allows remote attackers to cause a denial of service or possibly have unspecified other impact via a crafted call. Read more ...
2017-02-16 - The grapheme_strpos function in ext/intl/grapheme/grapheme_string.c in PHP before 5.5.35, 5.6.x before 5.6.21, and 7.x before 7.0.6 allows remote attackers to cause a denial of service (out-of-bounds read) or possibly have unspecified other impact via a negative offset. Read more ...

See All Entries...