← Back to EasyCron.com

May 13, 2017

Placeholders you could use in cron job URL

EasyCron added placeholder support in cron job URL today.

You could use placeholders:
__RANDOM__
__TIMESTAMP__
in your cron job URL.

__RANDOM__ will be replaced with a random 12-digit integer when your cron job is fired.
And __TIMESTAMP__ will be replaced with unix timestamp.

For example, URL
http://www.example.com?__RANDOM__
could finally be http://www.example.com?123456789000 when it's fired.

Random integer or timestamp in URL will prevent EasyCron's requests from hitting cache in your proxy or server.

3 comments:

  1. I need cron_job_id to be posted as GET or POST request along with Cron URL when its fired, how to get it?

    ReplyDelete
    Replies
    1. I know I can edit cron url and add cron_job_id with it but I don't want to hit API request just for that.

      Delete
    2. Thanks for your comment. There are 2 methods to do what you requested: 1) manually edit the URL to include the cron_job_id; 2) do it via API. How do you create your cron job (manually or API)? You could contact us at https://www.easycron.com/contact for further discussion.

      Delete