| 
									
										
										
										
											2018-06-20 09:07:35 +00:00
										 |  |  | 'use strict'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var stateUrl = 'https://api.telebit.ppl.family/api/telebit.cloud/pair_state/bca27428719e9c67805359f1'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var urequest = require('@coolaj86/urequest'); | 
					
						
							|  |  |  | var req =  { | 
					
						
							|  |  |  |   url: stateUrl | 
					
						
							|  |  |  | , method: 'GET' | 
					
						
							|  |  |  | , json: true | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | urequest(req, function (err, resp, body) { | 
					
						
							|  |  |  |   if (err) { | 
					
						
							|  |  |  |     console.error(err); | 
					
						
							|  |  |  |     return; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   console.log('Done:'); | 
					
						
							|  |  |  |   console.log(body); | 
					
						
							| 
									
										
										
										
											2018-06-22 23:52:47 -06:00
										 |  |  |   /* | 
					
						
							|  |  |  |    body.status = 'ready' | 'pending' | 'complete' | 'invalid' | 
					
						
							|  |  |  |    body.access_token // only in 'ready' state
 | 
					
						
							|  |  |  |    */ | 
					
						
							| 
									
										
										
										
											2018-06-20 09:07:35 +00:00
										 |  |  | }); |