我正在尝试使用voxbone的rest api服务上传地址证明。但我得到一个错误:“远程服务器返回错误:(500)内部服务器错误。”当我联系技术支持团队的voxbone团队他们说我的请求没有到达那里系统....请帮我解决这个问题
WebRequest myReq = WebRequest.Create("https://sandbox.voxbone.com/ws-voxbone/services/rest/regulation/address
");
myReq.Method = method;
myReq.ContentType = "multipart/form-data; boundary= XXX";
string username = xxxxxx;
string password = xxxxxx;
string usernamePassword = username + ":" + password;
UTF8Encoding enc = new UTF8Encoding();
myReq.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(enc.GetBytes(usernamePassword)));
string str2 = "
--XXX
Content-ID: createRegulationAddressRequest
Content-Type: application/json
{
"salutation" : "MR",
"companyName" : null,
"companyDescription" : null,
"firstName" : "rahul",
"lastName" : "singh",
"buildingNumber" : "23",
"identityDocumentProof" :
{
"Nationality" : "IND",
"identityDocumentType" : "NATIONAL_ID_CARD",
"identityDocumentNumber" : "jfklajfljsdfl;dslfj" ,
"issuingAuthority" : "jkhkjhkj",
"issuingDate" : "2017-11-30"
} ,
"extraFields" :
{
"Signatory date of birth" : "1993-01-05",
"Signatory place of birth" : "varanasi,India",
"Signatory tax code" : "dsdfsfsdf"
}
}
--XXX--
Content-ID: proofOfIdentityDocument
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Disposition: file-data; name="proofOfIdentityDocument"; filename=stripe.png
Wuppertal
--XXX--";
byte[] buffer3 = Encoding.GetEncoding("UTF-8").GetBytes(str2);
string result = System.Convert.ToBase64String(buffer3 );
Stream reqstr = myReq.GetRequestStream();
reqstr.Write(data, 0, data.Length);
reqstr.Close();
WebResponse wr = myReq.GetResponse();
Stream receiveStream = wr.GetResponseStream();
StreamReader reader = new StreamReader(receiveStream, Encoding.UTF8);
string content = reader.ReadToEnd();