Cloudshare Rest api allows to perform number of actions using web UI application. Client will do create the environments and check the status of its environments and take snapshop of them.
Let me explain how to get connect or authenticate with Cloudshare rest api in PHP:
Request Url: https://use.cloudshare.com/API/v2
Parameter Required for api request are:
– ver :- Its the version of api for example v2 and v3
– resource :- api function name
– UserApiId :- Assigned unique id by cloudshare. This will use in each api request.
– token :- use any random string of 10 characters. Combination must be include (a-z, A-Z, 0-9)
– timestamp :- use time in seconds. Use time(); php function to get it.
– signature: – HMAC signature. Use below paatern to create it.
– param -: This is optional parameter for each request.
Use below code to generate the random number :
To create signature string use below code:
See this example to get List Environment of cloudshare account via rest api call.
After following all the above step this script will show you List of Environments of client Cloudshare account.