get account summary

Added by Kristen over 7 years ago

My REST call with the Uri = https://api.test.nordnet.se/next/1/accounts/9210447/
Stopped working Saturday. It normally gives a summary of the account. Now I get a 500 intern serverfejl. I have tried to replaces the call with other REST calls - fortunately they keep working.
This is the piece of code that all my REST calls pass through, that gives the error when I call for the account summary.
Uri address = new Uri(BASE_URL + "/" + VERSION + "/" + requestPath);
HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest;
request.Method = method;
request.Accept = "application/json";
request.ContentType = "application/x-www-form-urlencoded";
request.PreAuthenticate = true;
request.Credentials = new NetworkCredential(session_key, session_key);
byte[] authBytes = Encoding.UTF8.GetBytes((session_key + ":" + session_key).ToCharArray());
request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(authBytes);
if (parameters != null && (method "POST" || method "PUT" || method == "DELETE")) {
byte[] byteData = UTF8Encoding.UTF8.GetBytes(CreateParameterList(parameters));
using (Stream postStream = request.GetRequestStream()) {
postStream.Write(byteData, 0, byteData.Length);
}
}

using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
    {
StreamReader reader = new StreamReader(response.GetResponseStream());
retVal += reader.ReadToEnd();
}
}
catch (System.Net.WebException e) {
Program.ADM.WriteErrorLog(e.Message + " : " + method+ " " + requestPath + "sendreq call");
}
return retVal;

Hope you can help me.
Kind regards
Kristen Bonnen


Replies (3)

RE: get account summary - Added by Erik over 7 years ago

Attans. Du hann före med 3 minuter. Jag måste börja skriva snabbare. =)

/Erik

RE: get account summary - Added by Nordnet Simon over 7 years ago

Hi, sorry for the late reply. It works again.

RE: get account summary - Added by Kristen over 7 years ago

Tak tak,

:)

Kristen

(1-3/3)