Example API call- phone number to email address

In the below code I continue on the with examples that we talked to during our webinar on Example API calls.  In the below code I demonstrate a service that allows you to return an email address for a mobile phone number.  This allows you to “email” a “text” to a phone!

Example API Call: emailing a text to a phone

IniRead, API_Secret_Key,Auth.ini,API, Secret
IniRead, API_ID,Auth.ini,API, ID

;***********Documentation:  https://www.data24-7.com/wiki/doku.php?id=api_2.0_instructions*******************
Endpoint:="https://api.data24-7.com/v/2.0"
QueryString:=QueryString_Builder({"user":API_ID,"pass":API_Secret_Key,"api":"T","p1":"682.209.8014"})


;***********API Call to Phone to email address *******************
HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1")
HTTP.Open("POST", Endpoint . QueryString) ;keep uppercase on GET or POST
HTTP.Send()
Response:=HTTP.ResponseText ;~ MsgBox,,title, % response
SciTE_Output(response) ;Text,Clear=1,LineBreak=1,Exit=0

;************Query String builders*********
QueryString_Builder(kvp){
for key, value in kvp
  queryString.=((A_Index="1")?(url "?"):("&")) key "=" value
return queryString
}

 

 

Example API call to get an email address associated to a phone number

Comments are closed.