Proyectos de Subversion LeadersLinked - Services

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 283
Línea 81... Línea 81...
81
        return new JsonModel($data);
81
        return new JsonModel($data);
82
    }
82
    }
Línea 83... Línea 83...
83
    
83
    
84
    public function addAction()
84
    public function addAction()
85
    {
-
 
86
        /*
-
 
87
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
88
        $currentUser = $currentUserPlugin->getUser();
-
 
89
        
-
 
90
        $request = $this->getRequest();
-
 
91
        
-
 
92
      //  if($request->isPost()) {
-
 
93
           
-
 
94
            $base_url = $this->config['leaderslinked.zoom.base_url'];
-
 
95
            $token = $this->getAccessToken();
-
 
96
 
-
 
97
            
-
 
98
            $client = new Client([
-
 
99
 
-
 
100
                'base_uri' => $base_url,
-
 
101
            ]);
-
 
102
            
-
 
103
            $response = $client->request('POST', '/v2/users/me/meetings', [
-
 
104
                'headers' => [
-
 
105
                    'Authorization' => 'Bearer ' . $token
-
 
106
                ],
-
 
107
                'json' => [
-
 
108
                    'topic' => 'Let s Learn WordPress',
-
 
109
                    'agenda' => 'Description Let s Learn WordPress',
-
 
110
                    'type' => 2,
-
 
111
                    'start_time' => '2023-01-30T20:30:00',
-
 
112
                    'duration' => '30', // 30 mins
-
 
113
                    'password' => '123456',
-
 
114
                    'timezone' => 'America/Caracas',
-
 
115
                    'settings' => [
-
 
116
                        'participant_video'=> 'true',
-
 
117
                        'auto_recording' => 'none',
-
 
118
                    ]
-
 
119
                ],
-
 
120
            ]);
-
 
121
 
-
 
122
 
-
 
123
 
-
 
124
            
-
 
125
            $data = json_decode($response->getBody()->getContents());
-
 
126
            echo '<pre>';
-
 
127
            print_r($data); 
-
 
128
            echo '</pre>';
-
 
129
            exit;
-
 
130
            
-
 
131
            
-
 
132
            //echo "Join URL: ". $data->join_url;
-
 
133
            //echo "<br>";
-
 
134
            //echo "Meeting Password: ". $data->password;
-
 
135
       
-
 
136
         
-
 
137
       } else {
-
 
138
            $data = [
-
 
139
                'success' => false,
-
 
140
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
-
 
141
            ];
-
 
142
            
-
 
143
            return new JsonModel($data);
-
 
144
        }
-
 
145
 
-
 
Línea 146... Línea 85...
146
        */
85
    {
147
        
86
        
148
        $token = 'EAAJaDxnm8uIBAGYjnYpOvjzm1BXbBgTtqfwn4YbagqIBGxfpWVZBObWtcnvfTJB6hMfHLWZBgG7dQ2O2UYMqZALYSLIQZC8swoNsHNYe3AMBkOjkt7YZBuIfXe22yyTgUZCBzGlsjbs0f72nNDvMlGNQlkCYNi3ZCDdXH61z9nW9xxUcdAnhk6M';
87
        $token = 'EAAJaDxnm8uIBAGYjnYpOvjzm1BXbBgTtqfwn4YbagqIBGxfpWVZBObWtcnvfTJB6hMfHLWZBgG7dQ2O2UYMqZALYSLIQZC8swoNsHNYe3AMBkOjkt7YZBuIfXe22yyTgUZCBzGlsjbs0f72nNDvMlGNQlkCYNi3ZCDdXH61z9nW9xxUcdAnhk6M';
Línea 179... Línea 118...
179
                    ]
118
                    ]
180
                ] */   
119
                ] */   
181
            ],
120
            ],
182
        ]);
121
        ]);
Línea 183... Línea -...
183
 
-
 
184
        echo '<pre>';
-
 
185
       print_r($response->getBody()->getContents()); 
-
 
186
       echo '</pre>';
-
 
Línea 187... Línea 122...
187
       exit;
122
 
Línea 188... Línea 123...
188
        
123
        
189
    }
124
    }
Línea 303... Línea 238...
303
                'headers' => [
238
                'headers' => [
304
                    'Authorization' => 'Bearer '. $token
239
                    'Authorization' => 'Bearer '. $token
305
                ]
240
                ]
306
            ]);
241
            ]);
Línea 307... Línea -...
307
 
-
 
308
            print_r($response->getBody()->getContents());
-
 
309
            exit;
-
 
310
            
-
 
311
            /*
-
 
312
            $data = json_decode($response->getBody());
-
 
313
            if ( !empty($data) ) {
-
 
314
                foreach ( $data->participants as $p ) {
-
 
315
                    $name = $p->name;
-
 
316
                    $email = $p->user_email;
-
 
317
                    echo "Name: $name";
-
 
318
                    echo "Email: $email";
-
 
319
                }
-
 
320
            }
-
 
321
            
-
 
322
            
-
 
323
        } else {
-
 
324
            $data = [
-
 
325
                'success' => false,
-
 
326
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
-
 
327
            ];
-
 
328
            
-
 
329
            
-
 
330
        }
-
 
331
        
-
 
332
        return new JsonModel($data);*/
242