Jump to content

CrowdinAPI - how to use login={crowdin-login-name}


Go to solution Solved by mLipok,

Recommended Posts

Posted (edited)
I am in the process of creating a UDF for CrowdinAPI.
I have a problem with one function.
 
 
 
This is my implementation.
Func _Crowdin_GetProjects()
    ; https://api.crowdin.com/api/account/get-projects?account-key={account-key}
    Local $sURL = 'https://api.crowdin.com/api/account/get-projects?account-key=' & _Crowdin_AccountKey()
    ConsoleWrite('! ' & $sURL & @CRLF)
    Local $oXmlHttp = ObjCreate("MSXML2.XMLHTTP.3.0")
    $oXmlHttp.Open('POST', $sURL, False)
    $oXmlHttp.Send()
    Local $output = $oXmlHttp.ResponseText
    $oXmlHttp = ''
    Return $output

EndFunc   ;==>_Crowdin_GetProjects

Func _Crowdin_AccountKey($vAccountKey = Default)
    Local Static $sACCOUNT_API_KEY = ''
    If $vAccountKey = Default Then
        Return $sACCOUNT_API_KEY
    Else
        $sACCOUNT_API_KEY = $vAccountKey
        Return $sACCOUNT_API_KEY
    EndIf
EndFunc   ;==>_Crowdin_AccountKey

I do not know how to use: login={crowdin-login-name}

curl -F "login={crowdin-login-name}" https://api.crowdin.com/api/account/get-projects?account-key={account-key}

Thank you in advance for any help.

mLipok

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • Solution
Posted

I found solution:

Func _Crowdin_GetProjects($sLoginName)
    ; https://api.crowdin.com/api/account/get-projects?account-key={account-key}
    Local $sURL = 'https://api.crowdin.com/api/account/get-projects?account-key=' & _Crowdin_AccountKey() & '&login=' & $sLoginName
    ConsoleWrite('! ' & $sURL & @CRLF)
    Local $oXmlHttp = ObjCreate("Microsoft.XMLHTTP")
    $oXmlHttp.Open('POST', $sURL, False)
    $oXmlHttp.Send('')
    Local $output = $oXmlHttp.ResponseText
    $oXmlHttp = ''
    Return $output

EndFunc   ;==>_Crowdin_GetProjects

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...