Code examples to get you started


PHP


Python


Troubleshooting

ImgCake works out of the box, but there may some instances when things may go wrong. So there should be a way to troubleshoot what may have happened. With each request we send a couple of headers back as shown below

X-ImgCake-JID This is unique request ID given to webshot request. You can get either goto your members area and search on previous requests by this ID or getting a JSON reply is another option. How does it work? Getting job detail end point is located here
https://www.imgcake.com/jobs/?api_key=APIKEY&job_id=JOBID You will get a JSON response. An example is shown below
				{
				  "status": "ok",
				  "job_id": "4458779",
				  "org_req": "http://www.imgcake.com/APIKEY/TOKEN/jpeg?viewport=1280x1024&url=https%3A%2F%2Fwww.jaspreetchahal.org&token=TOKEN_VALUE",

				  "request": {
				    "submitted": "2014-11-26 00:04:53",
				    "viewport": "1280x1024",
				    "url": "https://www.jaspreetchahal.org",
				    "fullpage": false
				  },
				  "headers": {
				    "X-ImgCake-Status": "HTTP/1.1 200 OK",
				    "X-ImgCake-JID": "4458779",
				    "X-ImgCake-Result": "Ok"
				  }
				}
			
If Job data has been flushed or JOBID is invalid you will get this error
                {
                    "error":"404"
                }
            
X-ImgCake-Result This is the status of your request. Value for this can be Pass or Fail
X-ImgCake-Status This response we get when we hit the requested URL for taking a screenshot. Example HTTP/1.1 200 Ok or HTTP/1.1 404 Not Found etc.