We're just setting up a central dashboard for a customer to view various metrics, and having an issue using the CS_REST_Clients provided in the sample code.
Authentication is working fine, and we can pull list of countries / etc, however when we call
$wrap = new CS_REST_Clients(
Substituting in our client id for where i've put 12345 above too - same client id used in the get_authorize_url which is working without error - gives us the following :
Failed with code 401
public 'Code' => int 102
public 'Message' => string 'Invalid ClientID' (length=16)
Have tried passing it as a string, and an integer, no luck.
It's most likely that you're not using the correct ClientID. Check out http://www.campaignmonitor.com/api/getting-started/#clientid to see how you can get your ClientID (you want the ClientID and not the Client's API Key).
If that still doesn't work for you, please email email@example.com with your account url (https://something.createsend.com) and we'll dig deeper as to what the problem is.