Un flow d’exemple
[
{
"id": "eee1757110226f86",
"type": "tab",
"label": "Ecowatts -> Gladys",
"disabled": false,
"info": "",
"env": []
},
{
"id": "27ed541908cb256d",
"type": "oauth2",
"z": "eee1757110226f86",
"name": "",
"container": "oauth2Response",
"grant_type": "client_credentials",
"access_token_url": "https://digital.iservices.rte-france.com/token/oauth/",
"authorization_endpoint": "",
"redirect_uri": "/oauth2/redirect_uri",
"open_authentication": "",
"username": "",
"password": "",
"client_id": "XXXXXXXXXXXXXXXXXXX",
"client_secret": "XXXXXXXXXXXXXXXX",
"scope": "",
"rejectUnauthorized": true,
"headers": {},
"x": 250,
"y": 60,
"wires": [
[
"e54c33cdc4a66e73"
]
]
},
{
"id": "5c8888796344fe7e",
"type": "debug",
"z": "eee1757110226f86",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 680,
"y": 60,
"wires": []
},
{
"id": "4141ecf227805b07",
"type": "inject",
"z": "eee1757110226f86",
"name": "Get",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 60,
"wires": [
[
"27ed541908cb256d"
]
]
},
{
"id": "d1cc9455efc67f83",
"type": "http request",
"z": "eee1757110226f86",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://digital.iservices.rte-france.com/open_api/ecowatt/v4/signals",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 530,
"y": 60,
"wires": [
[
"5c8888796344fe7e"
]
]
},
{
"id": "e54c33cdc4a66e73",
"type": "function",
"z": "eee1757110226f86",
"name": "function 1",
"func": "msg.headers = {\n Authorization: \"Bearer \"+msg.oauth2Response.access_token\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 60,
"wires": [
[
"d1cc9455efc67f83"
]
]
}
]