Blog

API Keys Access

Which APIs Can My Client Access?

February 20, 2017 by Javier Garza

Ever wonder which APIs your client can access, and whether you have read/write privileges? This blog will help you identify the type of access your API client has. This can be a godsend if you are debugging access issues with a given API client.

You'll be using two command-line developer tools (HTTPie, and optionally jq), and two UNIX tools (tr and sed) to format the output. The command is just the first line (which have line-breaks for readability), the other lines are the output.

http :/-/client-api/active-grants/implicit | jq '.name,.scope' | tr " " "\n" |sed 's#"##g;s#scope:##;s#https://.*/scope/##;s#/-/#=>#'

jgarza-test config-edns=>readwrite config-dns=>readwrite data-edns=>read data-dns=>read events=>readwrite alerts=>readwrite billing-usage=>readwrite cases=>readwrite user-admin=>readwrite config-edgeredirector-data=>readwrite config-visitor-prioritization-data=>readwrite api-test=>read papi=>readwrite lds=>readwrite cloudlets=>readwrite feo=>readwrite cps=>readwrite billing-center-api=>readwrite invoicing-api=>readwrite sla-api=>readwrite case-management=>readwrite diagnostic-tools=>readwrite rum-api=>readwrite contract-api=>read adaptive-acceleration=>readwrite

Note: If you don't have, or don/t want to install jq, you could use this command instead:

http :/-/client-api/active-grants/implicit | tr "," "\n" |grep --color=never -e scope -e name |  tr " " "\n" |sed 's#"##g;s#scope:##;s#https://.*/scope/##;s#/-/#=>#;s#}##'

 

Implementation Notes

  • See this blog for more information on using HTTPie and jq with the Akamai APIs.
  • You can type "man tr" or "man sed" on a UNIX system for more information about those two commands.