Code: Select all
Returns JSON encoded object. creditBalance value gives current credits on the account. number is the phone number that was requested. carrier_type is whether the number is a landline or mobile. carrier is valid if carrier_type is mobile -- it will return the cell phone provider.
I am very new to HTTPRequest so I am missing something. I get a null message in the MsgBox.
I need to return the values for creditBalance, carrier_type and the cell phone Provider.
Here is the API Call code I have tried.
Token := "2971615f5ffdeb2dd2395ef34b6adc10e3f84abc"
EndPoint := "http://www.carrierlookup.com/index.php/api/lookup?key=" . Token
Type := "lookup"
Format := "JSON"
Full_URL := "http://www.carrierlookup.com/index.php/api/lookup?key=" . Token
Status := HTTP.Status
;***********************************************
HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1")
HTTP.Open("POST", Full_URL)
HTTP.SetRequestHeader("Accept", "*/*")
HTTP.SetRequestHeader("Accept-Language","en-US")
HTTP.SetRequestHeader("Content-Type", "application/x-www.form-urlencoded")
HTTP.Send(phonenumber)
HTTP.Status
;~ msgbox % http.GetAllResponseHeaders()
JSON_Data :=http.ResponseText
MsgBox % Status
MsgBox % JSON_Data