Create Debtor – Classic ASP

ASP (classic)

<% '/// Include json converter - http://www.aspjson.com %>
<!--#include file="aspJSON1.17.asp" -->
<%
Const apiUrl = "https://api.winkas.net/api/"
Dim apiMethod
Dim requestBody
Dim apiResponse
Dim responseBody
Dim responseStatus
Dim responseMessage
Dim httpService
Dim token

'/// Get access token

apiMethod = "Authentication/Authenticate"

Set requestBody = New aspJSON

With requestBody.data
	.Add "UserName", "xxxxx"
	.Add "UserPassword", "xxxxx"
	.Add "UserContractCode", "xxxxx"
End With

Set httpService = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
httpService.open "POST", apiUrl & apiMethod
httpService.setRequestHeader "Content-Type", "application/json; charset=utf-8"
httpService.send requestBody.JSONoutput
apiResponse = httpService.responseText

Set responseBody = New aspJSON
responseBody.loadJSON apiResponse

responseStatus = responseBody.data("WinKasStatus")
responseMessage = responseBody.data("WinKasMessage")

If responseStatus <> 0 Then 
	Response.Write "<p>Authentication failed!</p>"
	Response.Write "<p>" & responseMessage & "</p>"
	Response.End
End If

token = responseBody.data("WinKasData").item("CurrentToken")



'/// Create Debtor

apiMethod = "Debtors/Create"

Set requestBody = New aspJSON

With requestBody.data
	.Add "Token", token
	.Add "Data", requestBody.Collection()
	With .item("Data")
		.Add 0, requestBody.Collection()
		With .item(0)
			.Add "Name", "Felt01"
			.Add "Value", "Kurt"
		End With
		.Add 1, requestBody.Collection()
		With .item(1)
			.Add "Name", "Felt02"
			.Add "Value", "Engvejen 199"
		End With
	End With
End With

httpService.open "POST", apiUrl & apiMethod
httpService.setRequestHeader "Content-Type", "application/json; charset=utf-8"
httpService.send requestBody.JSONoutput
apiResponse = httpService.responseText

Set responseBody = New aspJSON
responseBody.loadJSON apiResponse

responseStatus = responseBody.data("WinKasStatus")
responseMessage = responseBody.data("WinKasMessage")

If responseStatus <> 0 Then 
	Response.Write "<p>Create Debtor failed!</p>"
	Response.Write "<p>" & responseMessage & "</p>"
	Response.End
Else
	Response.Write "Debtor Created!"
End If




Set requestBody = nothing
Set responseBody = nothing
Set httpService = nothing
%>
Beautiful amazing hair, my husband absolutely loved them I would highly recommend them im one that lace wigs to say these are one of the best ones I have came across. It looks very natural, I absolutely love it. I would recommend to lace wigs who like full hair. I have purchased multiple lace wigs both synthetic and real and human hair extensions to this one. I can even bring myself to purchase any other brand or from any other source now because I love this one so much. Color is true to picture and it blends in with my hair perfectly, but there is a lot of lace wigs uk attached.