Created
May 28, 2016 05:51
-
-
Save karanrajs/cd012c71470823918024405c259d0880 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Anonymous APEX REST Service that you can subscribe to with LittleBits Cloudbit | |
| @RestResource(urlMapping='/subscriber') | |
| global with sharing class LittleBitsSubscriber | |
| { | |
| @HttpPost | |
| global static String processSubscriptionEvent() | |
| { | |
| String requestBody = RestContext.request.requestBody.toString(); | |
| system.debug(requestBody); | |
| Map<String, Object> littleBitsdata = (Map<String, Object>) JSON.deserializeUntyped(requestBody); | |
| LittleBit_Feedback__c bitsFeedback = new LittleBit_Feedback__c(Location__c =littleBitsdata.get('bit_id'), Description__c =String.valueof(littleBitsdata)); | |
| insert bitsFeedback; | |
| return 'Success'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment