<<

# Duo::API

- NAME
- SYNOPSIS
- SEE ALSO
- COPYRIGHT
- DESCRIPTION

# NAME

Duo::API - Reference client to call Duo Security's API methods.

# SYNOPSIS

     use Duo::API;
     my $client = Duo::API->new('INTEGRATION KEY', 'SECRET KEY', 'HOSTNAME');
     my $res = $client->json_api_call('GET', '/auth/v2/check', {});

# SEE ALSO

Duo for Developers: https://www.duosecurity.com/api

# COPYRIGHT

Copyright (c) 2013 Duo Security

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

# DESCRIPTION

Duo::API objects have the following methods:

new($integration_key, $integration_secret_key, $api_hostname)

  Returns a handle to sign and send requests. These parameters are obtained when creating an API integration.

json_api_call($method, $path, \%params)

  Make a request to an API endpoint with the given HTTPS method and parameters. Returns the parsed result if successful or dies with the error message from the Duo Security service.

api_call($method, $path, \%params)

  Make a request without parsing the response.

canonicalize_params(\%params)

  Serialize a parameter hash reference to a string to sign or send.

sign($method, $path, $canon_params, $date)

  Return the Authorization header for a request. `$canon_params` is the string returned by canonicalize_params.

<<