function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

cant connect to hoover s Api (Urgent)

i am having trouble getting connection Hoovers Api, i have given accesss to

In this i am getting exception-------------------  System.HttpResponse[Status=Forbidden, StatusCode=403]


Please do respond urgently


Heres my code i got it fromlink::::


global with sharing class HttpCallout_CLS{

String Accid = apexPages.currentPage().getParameters().get('id');

Public void sendRequest(){
    String env;
    integer j,k;
    HttpRequest req = new HttpRequest();

    String API_KEY = 'XXXX'; // Use Api Key
    Blob headerValue = Blob.valueOf(API_KEY);
    String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
    req.setHeader('Authorization', authorizationHeader);
    String CName = apexPages.currentPage().getParameters().get('Name');


              // **** removing special characters from a account name*****
    List<String> spl= New List<String>{'@','#','$','%','^','&','*','(',')','!','.','"','<','>','?'};
    List<String> li = New List<String>();
    String CompName='';
                 li[j]=' ';
   for(Integer l=0;l<li.size();l++){
       CompName = CompName + li[l];

//constucting request body

 env = '<soapenv:Envelope xmlns:soapenv="" xmlns:sch="">'+
              '<sch:keyword>'+CompName+'</sch:keyword>'+  // search keyword


     req.setBody(env);  // sending request to the API
   Http http = new Http();

   HTTPResponse res = http.send(req);  // getting response from the API








Anup JadhavAnup Jadhav

Error Code 403 indicates that access to the intended resource is not allowed.


According to wikipedia:


"n the HTTP used on the World Wide Web, 403 Forbidden is an HTTP status code returned by a web server when a user requests a web page or media that the server does not allow them to access. In other words, the server can be reached, but the server declined to allow access to the page. This response is returned by the Apache web server when directory listings have been disabled. Microsoft IIS responds in the same way when directory listings are denied."


There are several reasons for this error code:

1. You are successfully authenticated but are not authorized to access the resource.

2. There was a temporary problem on the server, and might work after some time.


Most likely it's 1. I'd double check the API key, and also check your access rights(read/write) for the resource.






Hi i double checked the api key it correct. How do i check the acess right of the resource




any reason for making SOAP request by hand, instead of genrating Apex from the WSDL?



Initially  when i parsed hoovers wsdl i had problems with <group> ,i fixed that. After that I was getting schema exceptions while i tried to generate classes form wsdl. Started to work in salesforce this month only.Bit stuck up. not much help from internet. If do u know any link which gives the the wsdl which does not have any errors in hoovers schema.