<?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: redirects from api.meraki.com sockets in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428608#M4730</link>
    <description>&lt;P&gt;To me it's all keys. Keys should be private, even if you need multiple keys in order to complete a transaction.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2020 20:29:26 GMT</pubDate>
    <dc:creator>Nash</dc:creator>
    <dc:date>2020-01-24T20:29:26Z</dc:date>
    <item>
      <title>redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428603#M4725</link>
      <description>&lt;P&gt;Hi team. &lt;/P&gt;&lt;P&gt;Bit of an odd question. Using sockets to send my GET's, and if I send it directly to &lt;A href="https://api.meraki.com" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api.meraki.com&lt;/A&gt; it redirects to n151.meraki.com.&lt;/P&gt;&lt;P&gt;All well and good, I just followed the redirect and used that GET as my reference.&lt;/P&gt;&lt;P&gt;My question is if the API's all go through n151, or if I will really need to parse that initial response to the reply from &lt;A href="https://api.meraki.com" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api.meraki.com&lt;/A&gt; for the correct node. This is intended for anyone to be able to use, not just myself. &lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 19:14:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428603#M4725</guid>
      <dc:creator>andrewbluepiano</dc:creator>
      <dc:date>2020-01-24T19:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428604#M4726</link>
      <description>&lt;P&gt;Each org has a shard it's on, right? api.meraki.com attempts to identify the shard for your organization, then redirects to the correct shard. In this case, n151.&lt;/P&gt;&lt;P&gt;If you want to know the shard for a specific organization, you can use Get Organizations and then trim the org['url'] kinda like this. I'm using Python. Try running this in a Python shell.&lt;/P&gt;&lt;P&gt;Then you can just pass that to your request statement instead of api.meraki.com. Can speed things up a little...&lt;/P&gt;&lt;PRE class="lia-code-sample language-python"&gt;&lt;CODE&gt;org = {"id": "random", "name": "Test", "url": "https://n263.meraki.com/gibberish"}

print(f"Original URL: {org['url']}")
urlLength = org['url'].find('com') + 3
orgShard = org['url'][8:urlLength]

print(f"Trimmed shard URL: {orgShard}")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jan 2020 19:37:08 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428604#M4726</guid>
      <dc:creator>Nash</dc:creator>
      <dc:date>2020-01-24T19:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428605#M4727</link>
      <description>&lt;P&gt;Nash,&lt;/P&gt;&lt;P&gt;So if I send this &lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;GET /api/v0/networks/NETWORKNUM/clients HTTP/1.1
Host: api.meraki.com
Accept: application/json
x-cisco-meraki-api-key: keyhere
Content-Length: 15

timespan=1800&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to  &lt;A href="https://api.meraki.com," target="_blank" rel="noopener nofollow noreferrer"&gt;https://api.meraki.com,&lt;/A&gt; I get back&lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;You are being &amp;lt;a href="https://n151.meraki.com/api/v0/networks/NETWORKNUM/clients"&amp;gt;redirected&amp;lt;/a&amp;gt;.&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Just wanted to confirm that it changes based on the customers shard, which is sounds like is the case, and wasn't just n151 for all API stuff. Thanks for the clarification!&lt;/P&gt;&lt;P&gt;~Andrew Afonso~&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 20:03:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428605#M4727</guid>
      <dc:creator>andrewbluepiano</dc:creator>
      <dc:date>2020-01-24T20:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428606#M4728</link>
      <description>&lt;P&gt;Strongly recommend you scrub that network number that you've included. That's why my example just said gibberish. &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 20:09:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428606#M4728</guid>
      <dc:creator>Nash</dc:creator>
      <dc:date>2020-01-24T20:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428607#M4729</link>
      <description>&lt;P&gt;Oof. Thought about that, but I thought the only confidential part was the API key. How dangerous is publishing the network num (Just want to know if I need to go searching if I've done it anywhere else). &lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 20:26:23 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428607#M4729</guid>
      <dc:creator>andrewbluepiano</dc:creator>
      <dc:date>2020-01-24T20:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428608#M4730</link>
      <description>&lt;P&gt;To me it's all keys. Keys should be private, even if you need multiple keys in order to complete a transaction.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 20:29:26 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428608#M4730</guid>
      <dc:creator>Nash</dc:creator>
      <dc:date>2020-01-24T20:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428609#M4731</link>
      <description>&lt;P&gt;This is a great example of why I have been promoting the use of dotenv, and for the complete removal of API keys and sensitive information from code.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.meraki.com/t5/Developers-APIs/A-newer-safer-way-to-access-the-dashboard-API/m-p/69602" target="_self"&gt;https://community.meraki.com/t5/Developers-APIs/A-newer-safer-way-to-access-the-dashboard-API/m-p/69602&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 22:25:48 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428609#M4731</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2020-01-24T22:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428610#M4732</link>
      <description>&lt;P&gt;There is a new beta API service called "Mega Proxy" that does not use redirects.  You can try it out using &lt;SPAN&gt;api-mp.meraki.com instead of api.meraki.com.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 22:47:23 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428610#M4732</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2020-01-24T22:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428611#M4733</link>
      <description>&lt;P&gt;Lololol. Literally just finished &amp;amp; published the project I was asking for. But I may add that in. Can anyone just use the api-mp?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 22:50:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428611#M4733</guid>
      <dc:creator>andrewbluepiano</dc:creator>
      <dc:date>2020-01-24T22:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: redirects from api.meraki.com sockets</title>
      <link>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428612#M4734</link>
      <description>&lt;P&gt;&amp;gt;&lt;SPAN&gt;Can anyone just use the api-mp?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Yes.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 22:51:04 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/redirects-from-api-meraki-com-sockets/m-p/5428612#M4734</guid>
      <dc:creator>Philip D'Ath</dc:creator>
      <dc:date>2020-01-24T22:51:04Z</dc:date>
    </item>
  </channel>
</rss>

