UniBell

:

1)

2) .

 

.

POST - .

 (, )
 
  = ;  
 
  =  HTTP("api.unibell.ru",,,,,3,);
 
 ID = ( );
 
  =  ;

 .("reference", ID);
 .("sourceAddr", "78002220480");
 
  = (, ..);
  = "7" + (.(), 10);
 .("destAddr", );
 .("attempsNumber", 1);
 .("attempsInterval", 30);
 .("scenarioData", "text=" + );
 
 //  JSON  
 JSON =  JSON;
 JSON.( JSON(JSON., " ", ));
 
 JSON(JSON, );
 JS = JSON.();   
 
  =  ; 
 .("Content-Type", "application/json");
 .("X-Authorization", "AccessKey (    API)");
 
  =  HTTP("/apps/activate", );
 .(JS);
 
  = .();
 
  . = 200 
  JSON =  JSON;
  JSON.(.());
   = JSON(JSON, );
   .status = "ok" 
   //  ,          
    = ..();
   . = ();
   .ID = ID;
   . = ;
   
   . = JS;     
   .();
   
    = ;
    ;  
   ;
 
   ;
 
  

 

.

/ .

HTTP-, . 

.

 HTTP- . .

 () 
 
  = ..("type");
 
   = "endCallback" 
  
   = ..("reference");
   = ..("state");
   = ..("error");
     
   = ..();
  ..ID.();
  .();
  
   .() > 0 
   
    = [0];
    () = 0 
    . = ;
     ;
   
   JSON =  JSON;
   JSON.( JSON(JSON., " ", ));
   
   JSON(JSON, .);
   JS = JSON.();
   
   . = JS;
   .();
   
   // , 
   HTTP =  HTTP(200);  
     HTTP;
   
  
   
   HTTP =  HTTP(403);  
     HTTP;
   
    ;
  
 
  
  HTTP =  HTTP(403);  
    HTTP;
  
   ;  
 
  

 


image.png

image.png

© "", 2006-2023 www.infostart.ru