Python Twitter, Private Metrics 404

I’m using the python twitter wrapper,defined a new function in the api object.

def GetPrivateMetrics(self,status_id):
    url = '%s/labs/1/tweets/metrics/private' % (self.base_url)
    parameters = {'id': enf_type('status_id', int, status_id }
    resp = self._RequestUrl(url, 'GET', data=parameters)

the api is initialized with consumer key/secret and api key/secret

i can post statuses for the consumer but when i request private metrics from the status using the above function, i get 404s.

What Python wrapper is it? https://github.com/bear/python-twitter this one? My guess is the url is wrong when you combine it with base_url and parameters. Also i think it needs to be ids followed by a list of ids, not id

We have some sample code that might be helpful for you here. Another thing you might want to consider is that you have to enroll in Labs and attach an app to the metrics preview.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.