Articles in this section
Category / Section

Resolving Embed Code Validation Failed Error in Java

Published:

When embedding a dashboard using Java (Spring Boot), you may encounter a 400 Bad Request error with the message “Embed code validation failed.” This issue is likely due to the encoded value in the embed signature parameter value. To resolve this problem, pass the URL value without the encoded format.

Solution

  1. Use the RestTemplate class to create a new instance of RestTemplate.
RestTemplate restTemplate = new RestTemplate();
  1. Create a new instance of DefaultUriBuilderFactory and set its encoding mode to NONE. This will avoid encoding the query parameter, which is already encoded using the GetSignatureUrl method.
DefaultUriBuilderFactory defaultUriBuilderFactory = new DefaultUriBuilderFactory();
defaultUriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE);
  1. Avoid using hardcoded values for the embedQuery in the getDetails method. Instead, use the embedQueryString parameter from the Embed SDK.

By following these steps, you should be able to resolve the “Embed code validation failed” error when embedding a dashboard using Java (Spring Boot).

Additional References

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
SM
Written by Soundarya Mani Meharan
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied