public void registerMessagingServiceScopes(String consumerKey, String scope) throws Exception
{
ClientRequest request = new ClientRequest(ConsumerScopesRegistrationURL);
request.header("Authorization", "OpenId " + SubscriberOpenIdIdentifier);
request.formParameter(OAuth.OAUTH_CONSUMER_KEY, consumerKey);
request.formParameter("xoauth_scope", scope);
request.formParameter("xoauth_permission", "sendMessages");
ClientResponse<?> response = request.post();
response.releaseConnection();
if (HttpResponseCodes.SC_OK != response.getStatus()) {
throw new RuntimeException("Scopes can not be registered");