Created
April 22, 2021 21:29
-
-
Save JoeGlines/7be861bf8fb974aa2af37e8f9ded797c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;******************************************************* | |
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY | |
; Right now you can get a coupon code here: https://the-Automator.com/Learn | |
;******************************************************* | |
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment