Well I THINK I'm doing it right... here's an interactive python
session (have checked the apikey is correct!)
>>> import urllib
>>>
... api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx'
>>>
... # Post a single resource, xml response (which is default):
... url = '
http://www.ubervu.com'
>>> get_resource_url = '
http://api.contextvoice.com/1.2/resources/?apikey=%s' % api_key
>>> data = 'url=%s' % urllib.quote(url)
>>> urllib.urlopen(get_resource_url, data=data).read()
'<h1>403 Developer Inactive</h1>'
and here's my java code which in a much more long-winded, java-ey way,
gets me also to a 403:
public void submitUrlForTracking(URL sourceURL, Configuration prefs) {
URL queryURL = null;
try {
queryURL = new URL(
"
http://api.contextvoice.com/1.2/resources/?apikey="
+ licenseID);
} catch (MalformedURLException e2) {
logger.error("Malformed URL");
}
HttpURLConnection uc;
try {
String command = URLEncoder.encode("url", "UTF-8") + "="
+ URLEncoder.encode(sourceURL.toString(), "UTF-8");
logger.trace(queryURL);
logger.trace(command);
uc = (HttpURLConnection) queryURL.openConnection();
uc.setDoOutput(true);
uc.setUseCaches(false);
uc.setAllowUserInteraction(false);
uc.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
uc.setRequestMethod("POST");
uc.setRequestProperty("Content-length", Integer.toString(command
.length()));
DataOutputStream out = new DataOutputStream(uc.getOutputStream());
out.writeBytes(command);
out.flush();
out.close();
logger.trace(uc.getResponseCode() + " : " + uc.getResponseMessage
());
} catch (IOException e2) {
e2.printStackTrace();
}
}
Any insight much appreciated!
d
On Sep 9, 5:47 pm, Dan Ciotu <
dan.ci...@gmail.com> wrote:
> Hi Darrell,
>
> Please take a lot at this post maybe you'll find the fix right there:
>
>
http://groups.google.com/group/contextvoice-dev/browse_thread/thread/...
>
> If not, e-mail me the code and I'll try to see what's wrong.
>
> Best,
> Dan
>