{"_id":"582b482699595b3b00bb51a3","__v":5,"project":"56cacb1bc675f50b00a4b619","version":{"_id":"56cacb1cc675f50b00a4b61c","project":"56cacb1bc675f50b00a4b619","__v":14,"createdAt":"2016-02-22T08:47:24.528Z","releaseDate":"2016-02-22T08:47:24.528Z","categories":["56cacb1dc675f50b00a4b61d","56cc10aaca43550b0028125a","56cc10b7b4cbcf0b004a5df9","56cc1bb2272aa4130002ccd2","56cc5834b4cbcf0b004a5f8b","56cda18bface161300dae13b","56d51f2873dcd20b00fb87bb","56fbe0610023171700b96105","57658310c176520e00ea9076","5772bdd48c48e00e00503638","577c1dfe87acf617003c3fcd","579525172979790e00771a15","582b4661cdfdc125000c8684","586365cedfe6cc3700a7be63"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"user":"56caca84245b841300806def","category":{"_id":"582b4661cdfdc125000c8684","version":"56cacb1cc675f50b00a4b61c","__v":0,"project":"56cacb1bc675f50b00a4b619","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-11-15T17:31:13.213Z","from_sync":false,"order":5,"slug":"rewardsmojo-rest-api","title":"Rewards REST API"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-11-15T17:38:46.824Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[]},"method":"post","results":{"codes":[{"code":"{\n\t\"code\": 200,\n\t\"results\": {\n\t\t\"txn_id\": transaction_id,\n \"coupon_code\": coupon_code,\n \"brand_name\": brand_name,\n \"logo\": brand_logo,\n \"title\": reward_title,\n \"fineprint\": reward_fine_print,\n \"redemption_process\": reward_redemption_process,\n \"support\": rewards_support_channel,\n \"id\": numeric_id\n }\n}","language":"json","status":200,"name":""},{"name":"","code":"{\n\t\"code\": 400,\n \"status\": \"fail\",\n \"results\": error_message\n}","language":"json","status":400}]},"auth":"required","params":[{"_id":"582f2e19e367360f00bc5e2a","ref":"","in":"body","required":false,"desc":"Customer ID","default":"","type":"string","name":"customer_id"},{"_id":"582f2e5de367360f00bc5e2c","ref":"","in":"path","required":true,"desc":"App ID from the Codemojo dashboard","default":"","type":"string","name":"app_id"},{"_id":"582f2e5de367360f00bc5e2b","ref":"","in":"path","required":true,"desc":"Reward ID from the brand offer","default":"","type":"string","name":"reward_id"},{"_id":"582f59781be8d5190036ce01","ref":"","in":"body","required":false,"desc":"Lets you get rewards customized to that location. Short country code (IN, GB etc.)","default":"","type":"string","name":"locale"},{"_id":"582f59781be8d5190036ce00","ref":"","in":"body","required":false,"desc":"Latitude of the locale for which Rewards are to be retrieved for","default":"","type":"double","name":"lat"},{"_id":"582f59781be8d5190036cdff","ref":"","in":"body","required":false,"desc":"Longitude of the locale for which Rewards are to be retrieved for","default":"","type":"double","name":"lon"},{"_id":"582f59781be8d5190036cdfe","ref":"","in":"body","required":false,"desc":"Unique device id of the device/user/platform","default":"","type":"string","name":"device_id"},{"_id":"582f59781be8d5190036cdfd","ref":"","in":"body","required":false,"desc":"User Identifier - Email ID","default":"","type":"string","name":"email"},{"_id":"582f59781be8d5190036cdfc","ref":"","in":"body","required":false,"desc":"User Identifier - Mobile number of the user","default":"","type":"string","name":"phone"},{"_id":"582f59781be8d5190036cdfb","ref":"","in":"body","required":false,"desc":"Testing flag. Set 1 to enable testing or 0 to disable","default":"0","type":"int","name":"testing"},{"_id":"582f59781be8d5190036cdfa","ref":"","in":"body","required":false,"desc":"Flag to determine if Codemojo should send communication to the user regarding the Reward grabbed","default":"1","type":"int","name":"communicate"}],"url":"/v:version/services/rewards/grab/:app_id/:reward_id"},"isReference":true,"order":2,"body":"There are few optional parameters to help improve get a more personalized rewards catalogue for a particular user/location\n[block:callout]\n{\n \"type\": \"success\",\n \"title\": \"Reward Communication to Users\",\n \"body\": \"Codemojo sends out an email / sms to the users who grabs the rewards. This communication contains Reward details, T&C, Redemption process & other informations related to the grab. Please check the additional parameters section to see how you can enable / disable this feature\"\n}\n[/block]\n\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Webhook Callback\"\n}\n[/block]\nIf you have set up a web hook url when submitting the app, you will also get a callback to that url in the following format\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"customer_id\\\": customer_id,\\n \\\"communication_channel_email\\\": email_if_any,\\n \\\"communication_channel_phone\\\": phone_if_any,\\n \\\"hash\\\": enc_hash_verification,\\n \\\"coupon\\\":{\\n \\\"txn_id\\\": id,\\n \\\"coupon_code\\\": code,\\n \\\"brand_name\\\": name,\\n \\t\\t\\\"brand_url\\\": url_if_any,\\n \\\"logo\\\": logo,\\n \\\"title\\\": title,\\n \\\"fineprint\\\": fineprint,\\n \\\"redemption_process\\\": process,\\n \\\"support\\\": support,\\n\\t\\t \\\"value_formatted\\\": value_in_currency,\\n \\t\\t\\\"value_numeric\\\": value_in_numerics,\\n \\t\\t\\\"value_ratio\\\": value_ratio,\\n \\t\\t\\\"validity_stamp\\\": unix_timestamp,\\n \\t\\t\\\"validity\\\": formatted_date\\n }\\n}\",\n \"language\": \"json\"\n }\n ]\n}\n[/block]\n\n[block:image]\n{\n \"images\": [\n {\n \"image\": [\n \"https://files.readme.io/74950b3-Screen_Shot_2016-11-24_at_10.56.02_PM.png\",\n \"Screen Shot 2016-11-24 at 10.56.02 PM.png\",\n 1950,\n 716,\n \"#587c5c\"\n ],\n \"caption\": \"Adding the Webhook URL\"\n }\n ]\n}\n[/block]\n\n[block:callout]\n{\n \"type\": \"info\",\n \"title\": \"Hash validation\",\n \"body\": \"You can validate the integrity of the callback by checking the hash included. You can calculate the hash by generating a SHA1 value of your Client ID concatenated with the \\\"coupon\\\" json string\"\n}\n[/block]","excerpt":"Grab & deliver a reward to a particular user","slug":"grab-a-reward","type":"endpoint","title":"Grab a Reward"}
postGrab a Reward
Grab & deliver a reward to a particular user
Definition
{{ api_url }}{{ page_api_url }}
Parameters
Path Params
app_id:
required
string
App ID from the Codemojo dashboard
reward_id:
required
string
Reward ID from the brand offer
Body Params
customer_id:
string
Customer ID
locale:
string
Lets you get rewards customized to that location. Short country code (IN, GB etc.)
lat:
double
Latitude of the locale for which Rewards are to be retrieved for
lon:
double
Longitude of the locale for which Rewards are to be retrieved for
device_id:
string
Unique device id of the device/user/platform
email:
string
User Identifier - Email ID
phone:
string
User Identifier - Mobile number of the user
testing:
integer0
Testing flag. Set 1 to enable testing or 0 to disable
communicate:
integer1
Flag to determine if Codemojo should send communication to the user regarding the Reward grabbed