Created
          May 28, 2016 05:53 
        
      - 
      
- 
        Save karanrajs/f96c023ccf362e39fff3f410424d2575 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
    
  
  
    
  | String Id = '<Your-Device Id>'; | |
| String endpoint = '<Your-public webservice URL>'; | |
| String littleBitEvent = 'amplitude:delta:ignite'; | |
| String accessToken = '<Device AccessToken>'; | |
| Http h = new Http(); | |
| HttpRequest req = new HttpRequest(); | |
| req.setMethod('POST'); | |
| req.setEndpoint('https://api-http.littlebitscloud.cc/subscriptions'); | |
| req.setHeader('Authorization','Bearer ' + accessToken); | |
| req.setHeader('Accept', 'application/vnd.littlebits.v2+json'); | |
| req.setBody('publisher_id=' + Id + '&subscriber_id=' + endpoint); | |
| HttpResponse response = h.send(req); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment