I'm developing a Logic app that should call a specific API one time for a day to retrieve the response (a token) and on the next steps (not already written) it will contact another API and finally it will store the result on a Google spreadsheet. The problem is on the first call, reading the documentation of MailUp I must send a call to an URL to retrieve the token using username e password authentication ( https://help.mailup.com/display/mailupapi/Authenticating+with+OAuth+v2 ) but it doesn't work! Can someone help me?
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"HTTP": {
"inputs": {
"headers": {
"Authorization": "BASE64_ENCODED_CLIENTCREDENTIALS",
"Content-Type": "application/x-www-form-urlencoded"
},
"method": "POST",
"queries": {
"grant_type": "password",
"password": "password",
"username": "username"
},
"uri": "https://services.mailup.com/Authorization/OAuth/Token"
},
"runAfter": {
"Initialize_variable": [
"Succeeded"
]
},
"type": "Http"
},
"Initialize_variable": {
"inputs": {
"variables": [
{
"name": "responseBody",
"type": "String",
"value": ""
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"type": "ApiConnection"
},
"Set_variable": {
"inputs": {
"name": "responseBody",
"value": "@{body('HTTP')}"
},
"runAfter": {
"HTTP": [
"Succeeded"
]
},
"type": "SetVariable"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"Recurrence": {
"evaluatedRecurrence": {
"frequency": "Day",
"interval": 1
},
"recurrence": {
"frequency": "Day",
"interval": 1
},
"type": "Recurrence"
}
}
},
"parameters": {
"$connections": {
"value": {
}
}
}
}