Forum Discussion

michaelsatish's avatar
michaelsatish
Occasional Contributor
9 years ago

ALMComplete Rest API Call Error(Handler for Request not found)

 

The stated error is displayed when i make a rest api call to get a resource. Can someone please shed some light on this? thanks in advance

 

text - Handler for Request not found:

status_code - 404

 

url - 

https://<server>/rest-api/service/api/v1/projects/<projectID>/tests/<testcaseID>

 

I'm able to access the metadata and the response is 200

url -

https://<server>/rest-api/service/metadata

 

  • NBorovykh's avatar
    NBorovykh
    9 years ago

    Yes, ALMComplete 9.9.5 doesn't provide REST API. We introduced REST API in version 10.2, so if you want to use it, please consider upgrading your instance.  

     

    To get assistance with the upgrade, don't hesitate to contact SmartBear Customer Care.

    • Nastya_Khovrina's avatar
      Nastya_Khovrina
      SmartBear Alumni (Retired)

      Hi Satish,

       

      Could you please clarify which of the REST methods do you use? Do you face similar issues for different REST methods?

       

      Make sure that you have the target item in QAC - check Test Id and Project Id on the corresponding screens.

       

      If you use proxy, please try connecting to our web service without a proxy server.

       

      Anastasia
      Customer Care Team

      • michaelsatish's avatar
        michaelsatish
        Occasional Contributor

        Hi Natsya,


        Thanks for the reply. I've checked the Test Id and Project Id with the target (ALM Complete)

        Here is the code that I'm using written with Python and using requests libraries. The username and password are coming from JSON file

         

        url = 'https://<server>/rest-api/service/api/v1/projects/<project ID>/tests/<test ID>'
        token = base64.b64encode(bytes(data['credentials']['id'] + ':' + data['credentials']['password'], 'utf-8'))

        headers = {'Accept': 'application/json',
        'Authorization': 'Basic ' + str(token)
        }

        response = requests.get(url, headers=headers, verify=False)
        print(response.text)
        print(response.status_code)

         

        log.

         

        Handler for Request not found:


        Request.HttpMethod: GET
        Request.HttpMethod: GET
        Request.PathInfo: /api/v1/projects/<project ID>/tests/<test ID>
        Request.QueryString:
        Request.RawUrl: /rest-api/service/api/v1/projects/<project ID>/tests/<test ID>

        404