Glad you were able to find a solution that worked for you.
Cheers!
davinci wrote:I tried your plugin to substitute FantasticWeather. But I can't get any data. This is probably because my API uses OAuth 2.0:
https://developer.srgssr.ch/faq
Is there any way you can implement this?
Thank you
davinci wrote:Yes I tried, but it seems that I have to get the token first and it expires. Not sure how to automate this.
curl -X POST \
'https://api.srgssr.ch/oauth/v1/accesstoken?grant_type=client_credentials' \
-H 'Authorization: Basic <"KEY:SECRET"MANUALLY CONVERTED TO base64 >' \
-H 'Cache-Control: no-cache' \
-H 'Content-Length: 0' \
-H 'Postman-Token: 24264e32-2de0-f1e3-f3f8-eab014bb6d76'
curl -X GET \
'https://api.srgssr.ch/srf-meteo/colors' \
-H 'Authorization: Bearer MANUALLY ADDED RECEIVED_TOKEN' \
-H 'Cache-Control: no-cache' \
-H 'Postman-Token: 56128353-805e-4974-6689-5ef6d86e2d80'
11.2. Conditions
When a request header from an external application contains fields shown below, a Device issues events of status changes. If no event is required, do not include the specified fields:
X-AppName:MusicCast/XXX
X-AppPort:YYY
*Here XXX stands for an application version, YYY shows event receiving port.
Following is an example of MusicCast CONTROLLER:
X-AppName:MusicCast/1.40(iOS) X-AppPort:41100
Event notification timeouts in 10 minutes if no further event request is sent from an IP address set as event receiving device. If another request is made within 10 minutes of previous request, the timeout duration is reset and extended.
Event receiving port will be overwritten if a different port number is sent as a request by the registered device using X-AppPort.
# Headers to enable UDP status broadcast
headers = {'X-AppName':'MusicCast/1.71', 'X-AppPort':'41100'}
response = requests.request("GET", url, headers=headers, data=payload)
Users browsing this forum: No registered users and 1 guest