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 :: Uglify Tool :: 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:

  • UglifyIt

    Description: Uglifies/minifies your JavaScript and CSS code. Compiles LESS and SASS into CSS and minifies it.

    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)
                    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]
            
        

  • 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-07-25 - In all versions of PHP 7, during the unserialization process, resizing the 'properties' hash table of a serialized object may lead to use-after-free. A remote attacker may exploit this bug to gain arbitrary code execution. Read more ...
2017-07-25 - Off-by-one error in the phar_parse_pharfile function in ext/phar/phar.c in PHP before 5.6.30 and 7.0.x before 7.0.15 allows remote attackers to cause a denial of service (memory corruption) or possibly execute arbitrary code via a crafted PHAR archive with an alias mismatch. Read more ...

See All Entries...