Je viens de faire la procédure complète sur ma maquette.
J’ai créé un jeton PAT avec les droits ci-dessus.
Aucun problème.
[2025-04-21 11:22:03] DEBUG sendRequest - URL : https://api.smartthings.com/v1/apps METHODE : GET
[2025-04-21 11:22:03] DEBUG sendRequest - CODE : 200 RESPONSE : {"items":[],"_links":{}}
[2025-04-21 11:22:03] DEBUG checkAndCreateApp 1 $foundApp= $sameApp=
[2025-04-21 11:22:03] DEBUG checkAndCreateApp 2 $foundApp=
[2025-04-21 11:22:03] DEBUG checkAndCreateApp smartapp n'existe pas
[2025-04-21 11:22:03] DEBUG checkAndCreateApp body {"appName":"jeedom_plugin_smartthings1745227323","displayName":"jeedom_plugin_smartthings","description":"SmartApp API_ONLY for Jeedom plugin.","appType":"API_ONLY","singleInstance":false,"classifications":["CONNECTED_SERVICE","AUTOMATION"],"iconImage":{"url":"https://github.com/Flobul/Jeedom-SmartThings/raw/master/plugin_info/smartthings_icon.png"},"oauth":{"clientName":"my_jeedom","scope":["r:hubs:*","r:locations:*","r:rules:*","r:scenes:*","x:devices:*","w:rules:*","w:locations:*","w:devices:*","r:devices:*","x:locations:*","x:scenes:*"],"redirectUris":["https://moip/jeedom/plugins/smartthings/core/php/callback.php?apikey=XXXXXXXXX"]},"apiOnly":{"targetUrl":"https://mon-ip/jeedom/plugins/smartthings/core/php/callback.php?apikey=u4d0iwCst1rKpsJ0YtdquACEODm8ktCpZwsDY8Aas2yGIafNmrPeF6OVHVVGhSJY"}}
[2025-04-21 11:22:03] DEBUG sendRequest - URL : https://api.smartthings.com/v1/apps METHODE : POST
[2025-04-21 11:22:04] DEBUG sendRequest - CODE : 200 RESPONSE : {"app":{"appName":"jeedom_plugin_smartthings1745227323","appId":"7783f362-a8bb-4724-9198-ab6577b761a4","appType":"API_ONLY","principalType":"LOCATION","classifications":["CONNECTED_SERVICE","AUTOMATION"],"displayName":"jeedom_plugin_smartthings","description":"SmartApp API_ONLY for Jeedom plugin.","singleInstance":false,"iconImage":{"url":"https://github.com/Flobul/Jeedom-SmartThings/raw/master/plugin_info/smartthings_icon.png"},"installMetadata":{},"owner":{"ownerType":"USER","ownerId":"1c1a9d2c-197a-6f56-3196-cffc7917ef1a"},"createdDate":"2025-04-21T09:22:03Z","lastUpdatedDate":"2025-04-21T09:22:03Z","apiOnly":{"subscription":{"targetUrl":"https://mon-ip/jeedom/plugins/smartthings/core/php/callback.php?apikey=XXXXXXXXX","targetStatus":"PENDING"}}},"oauthClientId":"b7398a53-ef91-41d4-8ad9-732525d62822","oauthClientSecret":"f3385c74-e265-439a-8e9e-8cc5f08122b3"}
[2025-04-21 11:22:04] DEBUG checkAndCreateApp $createApp {"app":{"appName":"jeedom_plugin_smartthings1745227323","appId":"7783f362-a8bb-4724-9198-ab6577b761a4","appType":"API_ONLY","principalType":"LOCATION","classifications":["CONNECTED_SERVICE","AUTOMATION"],"displayName":"jeedom_plugin_smartthings","description":"SmartApp API_ONLY for Jeedom plugin.","singleInstance":false,"iconImage":{"url":"https:\/\/github.com\/Flobul\/Jeedom-SmartThings\/raw\/master\/plugin_info\/smartthings_icon.png"},"installMetadata":[],"owner":{"ownerType":"USER","ownerId":"XXXXXXXX-197a-6f56-3196-cffc7917ef1a"},"createdDate":"2025-04-21T09:22:03Z","lastUpdatedDate":"2025-04-21T09:22:03Z","apiOnly":{"subscription":{"targetUrl":"https:\/\/mon-ip\/jeedom\/plugins\/smartthings\/core\/php\/callback.php?apikey=XXXXXXXXXXXXXXXXXX","targetStatus":"PENDING"}}},"oauthClientId":"XXXXXXXXX-ef91-41d4-8ad9-XXXXXXXXX","oauthClientSecret":"XXXXXXXX-e265-439a-8e9e-XXXXXXXXX"}
[2025-04-21 11:22:04] DEBUG checkAndCreateApp 3 $foundApp=7783f362-a8bb-4724-9198-ab6577b761a4
[2025-04-21 11:22:04] DEBUG checkAndCreateApp smartapp existe
[2025-04-21 11:22:04] DEBUG sendRequest - URL : https://api.smartthings.com/v1/apps/7783f362-a8bb-4724-9198-ab6577b761a4 METHODE : GET
[2025-04-21 11:22:04] DEBUG sendRequest - CODE : 200 RESPONSE : {"appName":"jeedom_plugin_smartthings1745227323","appId":"7783f362-a8bb-4724-9198-ab6577b761a4","appType":"API_ONLY","principalType":"LOCATION","classifications":["CONNECTED_SERVICE","AUTOMATION"],"displayName":"jeedom_plugin_smartthings","description":"SmartApp API_ONLY for Jeedom plugin.","singleInstance":false,"iconImage":{"url":"https://github.com/Flobul/Jeedom-SmartThings/raw/master/plugin_info/smartthings_icon.png"},"installMetadata":{},"owner":{"ownerType":"USER","ownerId":"1c1a9d2c-197a-6f56-3196-cffc7917ef1a"},"createdDate":"2025-04-21T09:22:03Z","lastUpdatedDate":"2025-04-21T09:22:03Z","apiOnly":{"subscription":{"targetUrl":"https://mon-ip/jeedom/plugins/smartthings/core/php/callback.php?apikey=XXXXXXXXX","targetStatus":"PENDING"}},"ui":{"pluginUri":"","dashboardCardsEnabled":false,"preInstallDashboardCardsEnabled":false}}
[2025-04-21 11:22:04] DEBUG checkAndCreateApp checkApp {"appName":"jeedom_plugin_smartthings1745227323","appId":"7783f362-a8bb-4724-9198-ab6577b761a4","appType":"API_ONLY","principalType":"LOCATION","classifications":["CONNECTED_SERVICE","AUTOMATION"],"displayName":"jeedom_plugin_smartthings","description":"SmartApp API_ONLY for Jeedom plugin.","singleInstance":false,"iconImage":{"url":"https:\/\/github.com\/Flobul\/Jeedom-SmartThings\/raw\/master\/plugin_info\/smartthings_icon.png"},"installMetadata":[],"owner":{"ownerType":"USER","ownerId":"XXXXXXXXX-197a-6f56-3196-XXXXXXXXX"},"createdDate":"2025-04-21T09:22:03Z","lastUpdatedDate":"2025-04-21T09:22:03Z","apiOnly":{"subscription":{"targetUrl":"https:\/\/mon-ip\/jeedom\/plugins\/smartthings\/core\/php\/callback.php?apikey=XXXXXXXXXXXXXXX","targetStatus":"PENDING"}},"ui":{"pluginUri":"","dashboardCardsEnabled":false,"preInstallDashboardCardsEnabled":false}}
[2025-04-21 11:22:04] DEBUG Étape 2
...