Communication with SmartThings from third party

I have integrated smartThings with my smark locks. I’m able to communicate from smartThings with my app, but I’m unable to communicate with smartThings from my app using the code and token URL received during the discovery in callbackAccessHandler.
When trying to send update command event to smartThings using code and token URL, I’m getting 400 invalid code error.

Hi @Humza
Can you share with us the logs from the Schema connector since the moment you attempt to send a state update command to verify its content, please? and also include the error message you mentioned, I’m guessing you’re getting an interactionResult, right?

Hi @Itati I got that issue resolved. The schema connector was already extracting the tokens using the code being received in the grantCallbackAccess interaction type.
Right now the only issue I’m experiencing is at the time of discovery.
The issue only happens when I add the device to ST app for the first time. The error it shows me is ‘Couldn’t add device: A network or server error occurred. Try again later.’ Although the devices are added and device is linked.
After the first time I unlink and link the device again and everytime it shows success. I checked my logs in my lambda and grantcallback, discovery, and staterefresh are executed successfully and logs are same for the first time as well after first time.

Hi @Itati , any update on my latest post Communication with SmartThings from third party - #3 by Humza

1 Like

Hi @Humza

The engineering team has requested some additional information to investigate your case further. Could you please go through the entire process again until the error appears and send us the app logs? At the same time, please record the screen while showing the error.

Note: provide the timestamp of when the error happened, along with your local timezone.

If you have Android, follow these steps:

  1. Go to Menu > Gear Icon > About SmartThings
  2. Tap the SmartThings logo 10 times.
  3. This will open the developer’s space > tap ‘report a problem’
  4. This will send you to the report page. Select a frequency and write a short description of the issue.
  5. Click on “Report” and a log file will be generated for you to send over email, please do to build@smartthings.com

If you have IOS, follow these steps:
First:

  1. Enable the creation of additional logs in the app:
  1. In the ST app, go to “menu” > “settings”.
  2. At the bottom of that page, you’ll find a section called “Troubleshooting”. Please, enable the option that says “Create Additional SmartThings Log”.
  3. Restart the app
    Then:
  4. In the app menu, go to “contact us”
  5. Then, tap on “Error reports”
  6. On the opened page, tap 10 times on the title/label “What is the error about?” or until the prompt to create a log appears.
  7. Click on “ok” and wait for the process to finish. Then, save the generated file in the place you prefer and share it with us at build@smartthings.com