<?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: Connecting to AMP for Endpoints API in Endpoint Security</title>
    <link>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3895447#M1802</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for curl example. i am able to retrieve;&amp;nbsp; due to pagination 500 records come in a pull. I have large set of computers to extract daily for analysis.&amp;nbsp; Do you have any suggested script? - could be bash or python; which i can use it.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2019 08:05:10 GMT</pubDate>
    <dc:creator>arockiam.ponnusamy</dc:creator>
    <dc:date>2019-07-23T08:05:10Z</dc:date>
    <item>
      <title>Connecting to AMP for Endpoints API</title>
      <link>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429337#M1700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, hope all is well. I am trying to connect to the AMP for Endpoints API and receiving (401) Unauthorized error. I am using the API keys generated in the AMP cloud counsel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i cant seem to figure out is what should be my URL part after the @ character for&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;GET /v1/computers&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="https://" rel="nofollow" target="_blank"&gt;https://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;your_client_id&amp;gt;:&amp;lt;your_api_key&amp;gt;@&lt;/SPAN&gt;&lt;STRONG&gt;&amp;lt;api_endpoint&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2020 05:02:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429337#M1700</guid>
      <dc:creator>rzeygerman</dc:creator>
      <dc:date>2020-02-21T05:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AMP for Endpoints API</title>
      <link>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429338#M1718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "API endpoint" is the URL you use to submit API requests for your particular cloud -- api.amp.cisco.com for the NA public cloud or api.eu.amp.cisco.com for the EU cloud.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I usually find that it helps to take a look at one of the examples under "Resources" on the right-hand side of the main API doc page.&amp;nbsp; For example, under GET /v1/computers, it gives you this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;curl -X GET \
-H 'accept: application/json' \
-H 'content-type: application/json' \
--compressed -H 'Accept-Encoding: gzip, deflate' \
-u YOUR_API_CLIENT_ID \
https://api.amp.cisco.com/v1/computers
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, unlike the example you found on the first page, we're using the curl command line to pass in the username (client id), and letting it prompt us interactively for the password (api key).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&amp;nbsp; Please let us know if there are more questions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 19:36:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429338#M1718</guid>
      <dc:creator>brmcmaho</dc:creator>
      <dc:date>2016-11-03T19:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AMP for Endpoints API</title>
      <link>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429339#M1739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;STRONG style="font-size: 10.8px; font-family: arial; color: #3d3d3d;"&gt;&lt;A href="https://community.cisco.com//people/brmcmaho"&gt;brmcmaho&lt;/A&gt;&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess i was not clear. Yes i looked at the other pages and that it how i figured out the URL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, following your advice, i installed CURL for windows (previously i was trying to get this done with powershell) and ran the command above (no CURL console in windows, just command line )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;curl -X GET -H 'accept: application/json' -H 'content-type: application/json' --compressed -H 'Accept-Encoding: gzip, deflate' -u MY_API_CLIENT_ID&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://api.amp.cisco.com/v1/computer" rel="nofollow" target="_blank"&gt;http://api.amp.cisco.com/v1/computer&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the system responded back with:&lt;/P&gt;&lt;P&gt;&amp;nbsp; curl: (6) Could not resolve host: application&lt;/P&gt;&lt;P&gt;&amp;nbsp; curl: (6) Could not resolve host: application&lt;/P&gt;&lt;P&gt;&amp;nbsp; curl: (6) Could not resolve host: gzip,&lt;/P&gt;&lt;P&gt;&amp;nbsp; curl: (6) Could not resolve host: deflate'&lt;/P&gt;&lt;P&gt; curl: (1) Protocol "'http" not supported or disabled in libcurl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now found a way to test https by connecting to google and that worked. So this leaves me to believe that either there is a problem with my string above, or the generated Client ID or API key...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what would you advise &lt;STRONG style="font-size: 10.8px; font-family: arial; color: #3d3d3d;"&gt;&lt;A href="https://community.cisco.com//people/brmcmaho"&gt;brmcmaho&lt;/A&gt;&lt;/STRONG&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2016 14:50:37 GMT</pubDate>
      <guid>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429339#M1739</guid>
      <dc:creator>rzeygerman</dc:creator>
      <dc:date>2016-11-04T14:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AMP for Endpoints API</title>
      <link>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429340#M1759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I am about as far away from a PowerShell guru as you can imagine, but in my reading there seem to be lots of questions about how to do the equivalent of "curl -u username:password".&amp;nbsp; One thing I found that appears to work in my quick test is based on the following web page:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.dexterposh.com/2015/01/powershell-rest-api-basic-cms-cmsurl.html" style="font-size: 10pt;" title="http://www.dexterposh.com/2015/01/powershell-rest-api-basic-cms-cmsurl.html"&gt;DexterPOSH's Blog: PowerShell + REST API : Basic, CMS &amp;amp; CMSURL Authentication&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what I did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$Credential = Get-Credential&lt;/P&gt;&lt;P&gt;(You will be prompted for username and password)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$EncodedUsernamePassword = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($('{0}:{1}' -f $Credential.UserName, $Credential.GetNetworkCredential().Password)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$Headers = @{'Authorization' = "Basic $($EncodedUsernamePassword)"; 'accept' = 'application/json'; 'Content-type' = 'application/json'; 'Accept-Encoding' = 'gzip, deflate'}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Invoke-RestMethod -Method Get -Uri '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://api.amp.cisco.com/v1/computers" rel="nofollow" target="_blank"&gt;https://api.amp.cisco.com/v1/computers&lt;/A&gt;&lt;SPAN&gt;' -Headers $Headers&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 09:29:30 GMT</pubDate>
      <guid>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429340#M1759</guid>
      <dc:creator>brmcmaho</dc:creator>
      <dc:date>2016-11-09T09:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AMP for Endpoints API</title>
      <link>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429341#M1772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been fighting with this API for a few weeks trying to get it into syslog. I was able to get the curl string working on windows (under strawberry perl) by playing with the syntax a little, and though it's been a while since this thread was active, I think it could help future searchers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you remove the trailing spaces after the colons, the command works, as such:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: arial; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;curl -k -X GET -H 'accept:application/json' -H 'content-type:application/json' --compressed -H 'Accept-Encoding:gzip,deflate' -u MY_API_CLIENT_ID:api_key&amp;nbsp; '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://api.amp.cisco.com/v1/computer" rel="nofollow" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #0a63a7;" target="_blank"&gt;http://api.amp.cisco.com/v1/computer&lt;/A&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: arial; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: arial; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;however i can't get the basic auth working with the encoded credential, and there are other issues. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2017 18:31:04 GMT</pubDate>
      <guid>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429341#M1772</guid>
      <dc:creator>dsindell1</dc:creator>
      <dc:date>2017-03-29T18:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AMP for Endpoints API</title>
      <link>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429342#M1785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the Windows side of things, I did find that switching over to Powershell and the Get-Credential method was much more reliable than trying to shoehorn it into non-native curl.&amp;nbsp; Just for what it's worth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2017 19:36:48 GMT</pubDate>
      <guid>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3429342#M1785</guid>
      <dc:creator>brmcmaho</dc:creator>
      <dc:date>2017-03-29T19:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting to AMP for Endpoints API</title>
      <link>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3895447#M1802</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for curl example. i am able to retrieve;&amp;nbsp; due to pagination 500 records come in a pull. I have large set of computers to extract daily for analysis.&amp;nbsp; Do you have any suggested script? - could be bash or python; which i can use it.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 08:05:10 GMT</pubDate>
      <guid>https://community.cisco.com/t5/endpoint-security/connecting-to-amp-for-endpoints-api/m-p/3895447#M1802</guid>
      <dc:creator>arockiam.ponnusamy</dc:creator>
      <dc:date>2019-07-23T08:05:10Z</dc:date>
    </item>
  </channel>
</rss>

