#!/usr/bin/perl my $key = "YOUR API KEY HERE"; my $secret = "YOUR API SECRET HERE"; my $url = "https://apicurrent-app.booker.ninja/WebService4/json/CustomerService.svc/access_token?client_id=" . $key . "&client_secret=" . $secret . "&grant_type=client_credentials"; # Load our modules # Please note that you MUST have LWP::UserAgent and JSON installed to use this # You can get both from CPAN. use LWP::UserAgent; use JSON; my $ua = LWP::UserAgent->new(); my $body = $ua->get($url); # process the json string my $json = from_json($body->decoded_content); # print the results print $json->{access_token};