Avatar of ukerandi
ukerandi
Flag for United Kingdom of Great Britain and Northern Ireland asked on

No records found -500 Internal Server Error

Hi experts,
I have wrote the C# API programe to get data from different location.
All used to work fine.Suddenly it's generating error becuase the records not available
in the API records.(requesting records)There is no way to find Candidate avaiable or not.

see below link how the API request send.

https://test/v3/company/18f62e940d1d01/position/771b0f2aff3c01/candidate/05ea659e456a01/stream

Error:

 500 Internal Server Error
{
    "error": {
        "type": "getStreamError",
        "message": "there was an unknown error getting candidate stream."
    }
}

 string urlCandatestream = "/company/" + CompanyID + "/position/" + positionID + "/candidate/" + candidateID + "/stream";
                var request = new RestRequest(urlCandatestream, Method.GET);


                request.AddHeader("Content-Type", "application/json");
                request.AddHeader("cache-control", "no-cache");
                request.AddHeader("authorization", connectAPI.getAccessToken());
                // rqst.Proxy = GlobalProxySelection.GetEmptyWebProxy();

                IRestResponse response;
                varRequest = request.ToString();
                try
                {
                    response = await _restClent.ExecuteTaskAsync(request);
                    VarRequestResults = response.Content;
                }
                catch (Exception ex)
                {
                    throw new Exception("Error executing  request to " + urlCandatestream, ex);
                }

Open in new window

Any logic or idea how to get rid of this and only get available records.
ASP.NETVisual Basic.NET.NET ProgrammingC#JSON

Avatar of undefined
Last Comment
ukerandi

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dr. Klahn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ukerandi

ASKER
thanks i found the issue,becuase no records available .
ukerandi

ASKER
:)
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23