Question: API trouble with get_latest_installable_revisions
gravatar for cgpwytko
3.1 years ago by
United States
cgpwytko0 wrote:

I'm attempting to use the python api get_latest_installable_revisions in the galaxy folder


using curl in php with the following code


    public function get_latest_installable_revision ($admin_api_key, $tool_shed_url, $name_of_repo, $name_owner_of_repo){

        $i = curl_init();

        $api_key = $this->galaxy->getAPIKey();

        $url = $this->galaxy->getURL() . '/api/tool_shed_repositories/' . 'get_latest_installable_revision';
        $data = array(
                'tool_shed_url' => ''
                'name' => 'codonlogo',
                'owner' => 'davidmurphy', 
                'key' => $api_key
        $data_string = '';
        foreach($data as $key=>$value) { 
            $data_string .= $key.'='.$value.'&'; 
        //rtrim($data_string, '&');
        print "\n";
        curl_setopt($i, CURLOPT_URL, $url);
        curl_setopt($i,CURLOPT_POST, count($data));
        curl_setopt($i, CURLOPT_POSTFIELDS, $data_string);
        curl_setopt($i, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($i, CURLOPT_RETURNTRANSFER, true);
        $result = curl_exec($i);
        $info = curl_getinfo($i);
        $array = json_decode($result, true);
        print_r ($array);


and receive the following error:

    [traceback] => Traceback (most recent call last):
  File "/home/cwytko/galaxy/lib/galaxy/web/framework/", line 258, in decorator
    rval = func( self, trans, *args, **kwargs)
  File "/home/cwytko/galaxy/lib/galaxy/webapps/galaxy/api/", line 115, in get_latest_installable_revision
    changeset_revisions = json.loads( raw_text )
  File "/usr/lib/python2.7/json/", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

    [err_msg] => Uncaught exception in exposed API method:
    [err_code] => 0


Any insight on this problem would be much appreciated



software error galaxy • 835 views
ADD COMMENTlink modified 3.1 years ago by Jennifer Hillman Jackson25k • written 3.1 years ago by cgpwytko0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 166 users visited in the last hour