Category / Section
Resolving Embed Code Validation Failed Error in Java application
Published:
When working with the Bold BI embedded dashboard in a Java application, you may encounter an “Embed code validation failed” error. This issue often occurs due to the encoded value appearing in the embed signature parameter value. To resolve this problem, you need to pass the URL value without encoded format.
Solution
If you are using RestTemplate in your application, follow the steps below:
- Create a RestTemplate instance:
RestTemplate restTemplate = new RestTemplate();
- Create a DefaultUriBuilderFactory instance and set the encoding mode to NONE:
DefaultUriBuilderFactory defaultUriBuilderFactory = new DefaultUriBuilderFactory();
defaultUriBuilderFactory.setEncodingMode(DefaultUriBuilderFactory.EncodingMode.NONE);
This will avoid encoding of query parameters that are already encoded using the GetSignatureUrl method.
- Avoid using hard-coded values for the embedQuery in the getDetails method. The embedQuery value should come from the embedQueryString parameter.
By following these steps, you should be able to resolve the “Embed code validation failed” error in Bold BI.