January 24, 2015
In order to interact with the RWS/REST API. You need to have a “consumer key” and “consumer secret” pair, just like Amazon Web Service.
If you do not have an application created, follow these steps:
Login to your MaxCDN Control Panel.
Click on Account in the main navigation menu area.
Click on API
Click Create Application
- In the Register application page, enter a name to identify your application, and a short description for it.
- The Application URL and Callback URL are optional. You only need them if the application is interacting between your website and our RWS server, so in the majority of cases this can be left blank. If it’s a simple app to send or receive information, then it safe to leave those two fields empty.
- Click Register Application.
Your consumer key and secret will be available on the next page.
If you already have an application created for you by a friend or colleague, follow these steps:
- Login to your CDN Control Panel.
- Click on Account in the main navigation menu area.
- Click on API
- On the list of registered applications click the Manage button next to the application you wish to use.
- Your Consumer Key and Secret will be available on the next page.
Different Use Cases
WordPress W3 Total Cache plugin
In order for you to use newly generated API key pair within W3 Total Cache (W3TC) plugin, you can either use the existing button in W3TC called “Authorize” it will generate the API key for you and construct it automatically so you can just copy-paste it in W3TC provided field.
Also, if you want to do it manually, this is the general form based on which your key will be constructed:
Many different approaches with custom applications that use our API are all relying to same registering process of API key pair:
api = MaxCDN("alias", "consumer_key", "consumer_secret")
@here “MaxCDN” is a class name you are loading from appropriate library (if older library is used it may be called “NetDNA” or “NetDNARWS”).
For more details on custom API usage visit our API documentation page.