Register an AWS Lambda function

Hi,
I am trying to register my AWS Lambda function using the curl command below from https://smartthings.developer.samsung.com/develop/guides/smartapps/app-registration.html. However I am getting the message below as a result. What might be causing the issue?

image

curl -X POST -H "Authorization: Bearer XXXXXX" -H "Content-Type: application/json" -H "Accept: application/json" -d '{
  "appName": "asdf",
  "displayName": "asdf",
  "description": "asdf",
  "appType": "LAMBDA_SMART_APP",
  "lambdaSmartApp": {
    "functions": [
      "arn:aws:lambda:us-east-1:709967513389:function:1"
    ]
  }
}' "https://api.smartthings.com/v1/apps"

maybe a result of this minor ST outage…


:slight_smile:

Has the ST outage been fixed now?

I retried the curl command, but now there is no message at all. Is there not supposed to be a response?

No, a successful response should return the app object created, as documented here: https://smartthings.developer.samsung.com/develop/api-ref/st-api.html#operation/createApp

If you’re using curl, try passing in the verbose option -v to see if that gives any more info like if you’re getting a 401 or 403 response for auth issues.

Thanks. I get a message now. I also want to know if executing this curl command is supposed to return a client id and secret? Right now I get the message below when I add “-v” to my curl command and I don’t get a client id and secret.

You’re getting a 403 which means the token you’re using doesn’t have permission to create an app. Verify that the token you’re using has the write apps (w:apps:*) scope. If it doesn’t, create a new token and be sure to check the write apps scope:

image

Thanks. If I want to delete the app, how can I do so through the curl command?

If the app was successfully created, you can delete it with a DELETE request to https://api.smartthings.com/v1/apps/{appNameOrId} as doc’d here: https://smartthings.developer.samsung.com/develop/api-ref/st-api.html#operation/deleteApp (also requires the token has the w:apps:* scopes as documented).

To get a list of apps for an account you can use this API (requires the l:apps scope on the token).

I deleted all my apps, but when I try to register my lambda function with the app name, “test”, it gives me the below. Why is this so?

App names are required to be globally unique and when deleted the app name still remains as registered. So, rename your new app with some unique identifier, eg “cookierookie-app-test-2”

Thanks for your help. Would you also be willing to help me out on this post: Account Linking URLs? I’d appreciate that.