##!/usr/bin/perl -l use strict; use warnings; use LWP::UserAgent; my $username = "Polycom"; my $password = "789"; my $phoneip = $ARGV[0]; my $user = $ARGV[1]; my $Address = $ARGV[2]; my $passcode = $ARGV[3]; my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, protocols_allowed => ['https'], ); my $URL = "https://$phoneip/api/v1/mgmt/skype/signIn"; { # Create the request object and add the authentication header and content my $req = HTTP::Request->new(POST => $URL); $req->content_type('application/json'); $req->authorization_basic( $username, $password ); $req->content('{"data":{"Address": "$Address","User": "$user","Password": "$passcode","Domain":"","LockCode":""}}'); # Send the request to the user agent and print the result my $response = $ua->request($req); print "\r\n"; print $response->decoded_content; }