<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl api example in APIs</title>
    <link>https://community.cisco.com/t5/apis/perl-api-example/m-p/4883724#M532</link>
    <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;Hi &lt;A class="mention" href="https://community.duo.com/u/bidwell"&gt;@bidwell&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;We have API demonstration clients for different languages in &lt;A href="https://github.com/duosecurity"&gt;GitHub&lt;/A&gt;. These are linked directly from the &lt;A href="https://duo.com/docs/adminapi#first-steps"&gt;Admin API documentation&lt;/A&gt;. &lt;A href="https://github.com/duosecurity/duo_api_perl"&gt;Here’s the one for Perl&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 06 Sep 2018 18:46:15 GMT</pubDate>
    <dc:creator>DuoKristina</dc:creator>
    <dc:date>2018-09-06T18:46:15Z</dc:date>
    <item>
      <title>Perl api example</title>
      <link>https://community.cisco.com/t5/apis/perl-api-example/m-p/4883723#M531</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;I am looking for an example of using the perl api to get a list one phone numbers in duo and deleting phone numbers from duo. If you use the web admin console to delete a user it deletes the phone device if no one else is using it also.  The api to delete a user does not.  As a result, I have 600+ orphaned phones that need to be deleted.  The web pages that describe the apis seem to be remarkably absent of any examples of how to actually use them.&lt;/P&gt;
&lt;P&gt;The following is an example perl program to delete a phone that doesn’t quite work.  It always returns a “40401 Resource not found” error.&lt;/P&gt;
&lt;P&gt;#!/usr/bin/perl&lt;BR /&gt;
use Net::Duo;&lt;BR /&gt;
use Data::Dumper;&lt;BR /&gt;
use Net::Duo::Admin;&lt;BR /&gt;
use Net::Duo::Admin::User;&lt;BR /&gt;
use Net::Duo::Admin::Phone;&lt;BR /&gt;
my ($cmd,$arg)=@ARGV;&lt;BR /&gt;
my %keys;&lt;BR /&gt;
$keys{‘integration_key’}=‘my_integration_key’;&lt;BR /&gt;
$keys{‘secret_key’}=‘my_secret_key’;&lt;BR /&gt;
$keys{‘ap_hostname’}=‘&lt;A href="http://ap-myhost.duosecurity.com" rel="nofollow noopener"&gt;■■■■&lt;/A&gt;’;&lt;BR /&gt;
my $duo= Net::Duo-&amp;gt;new(%keys);&lt;BR /&gt;
my $u="[$arg]";&lt;BR /&gt;
my $result=$duo-&amp;gt;call_json(‘DELETE’,"/admin/v1/phones/$u");&lt;BR /&gt;
print Dumper($result),"\n";&lt;/P&gt;
&lt;P&gt;The code generating the $duo object works for accessing user data, but not phone data.  Does anyone have any suggestions for actually getting this to work?&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Sep 2018 12:42:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/perl-api-example/m-p/4883723#M531</guid>
      <dc:creator>bidwell</dc:creator>
      <dc:date>2018-09-06T12:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Perl api example</title>
      <link>https://community.cisco.com/t5/apis/perl-api-example/m-p/4883724#M532</link>
      <description>&lt;DIV class="duo-migrated-content"&gt;&lt;P&gt;Hi &lt;A class="mention" href="https://community.duo.com/u/bidwell"&gt;@bidwell&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;We have API demonstration clients for different languages in &lt;A href="https://github.com/duosecurity"&gt;GitHub&lt;/A&gt;. These are linked directly from the &lt;A href="https://duo.com/docs/adminapi#first-steps"&gt;Admin API documentation&lt;/A&gt;. &lt;A href="https://github.com/duosecurity/duo_api_perl"&gt;Here’s the one for Perl&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Sep 2018 18:46:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/apis/perl-api-example/m-p/4883724#M532</guid>
      <dc:creator>DuoKristina</dc:creator>
      <dc:date>2018-09-06T18:46:15Z</dc:date>
    </item>
  </channel>
</rss>

