1
Orion 알림을 사용하여 Plivo에서 SMS를 보내려고합니다.오리온 알림 복합기 페이로드
curl -X POST https://api.plivo.com/v1/Account/MAMDA5ZDJIMDM1/Message/ -L -u MAMDA5ZDJIM:YzhiNDJjODNhNDkxMjhiYTgxZD -H 'Content-Type: application/json' -d @- <<EOF
{
"src": "0039414141414",
"dst": "0039414747111",
"text": "test SMS"
}
EOF
가 어떻게 그것을 인코딩해야 오리온에 : 나는 Plivo와 직접 SMS를 보낼 방법 이다? 나는 시도했다 :
curl localhost:1026/v2/subscriptions -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- <<EOF
{
"description": "A subscription to get info about WS_UPPA_Sensor2",
"subject": {
"entities": [
{
"id": "Sensor1",
"type": "SensingDevice"
}
],
"condition": {
"attrs": [
"temperature"
]
}
},
"notification": {
"httpCustom": {
"url": "https://api.plivo.com/v1/Account/MAMDA5ZDJIMDM1NZVMZD/Message/",
"headers": {
"Authorization": "Basic TUFNREE1WkRKSU1ETTFOWlZNWkQ6WXpoaU5ESmpPRE5oTkRreE1qaGlZVGd4WkRkaE5qYzNPV1ZsTnpZMA=="
},
"payload": "{%22src%22%3A%2200393806412092%22%2C%22dst%22%3A%2200393806412093%22%2C%22text%22%3A%22test%20SMS%20from%20Waziup%22}"
},
"attrs": [
"temperature"
]
},
"expires": "2040-01-01T14:00:00.00Z",
"throttling": 5
}
EOF
퍼센트 인코딩보다 다른 방법이 있습니까?
http://fiware-orion.readthedocs.io/en/master/user/forbidden_characters/#specific-restrictions-for-id-fields 내가 그렇게 내 페이로드를 인코딩 : "페이로드" "{% 22src % 22 : % 2200393806412092 % 22, % 22dst % 22 : % 2200393806412093 % 22, % 22text % 22 : % 22test % 22}" 맞습니까? 따옴표 만 이스케이프해야합니다 ("}"또는 ":"또는 ","가 아님)? – cdupont
맞습니다. "}", ":"및 ","는 금지 된 문자가 아니므로 직접 사용할 수 있습니다. Orion이 실제로 보내는 메일을 확인하는 것이 좋습니다. http://requestb.in 도구를 사용하여 (적절하게 서브 스크립 션' "url"을 조정하십시오.) – fgalan