# See JSON object sent by okta-sdk-java on update

**URL:** <https://devforum.okta.com/t/see-json-object-sent-by-okta-sdk-java-on-update/16439>\
**Category:** OAuth/OIDC\
**Tags:** api, java\
**Created:** [October 4, 2021, 8:45am UTC](https://devforum.okta.com/t/see-json-object-sent-by-okta-sdk-java-on-update/16439 "2021-10-04T08:45:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hekmil](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@Hekmil](https://devforum.okta.com/u/Hekmil)\
**Post date:** [October 4, 2021, 8:45am UTC](https://devforum.okta.com/t/see-json-object-sent-by-okta-sdk-java-on-update/16439/1 "2021-10-04T08:45:33Z")

</div>

Hi,

I’m using [okta-sdk-java](https://github.com/okta/okta-sdk-java) to update apps in Okta from a JSON payload get from another tenant.

My issue is that updating an OIDC app doesn’t work when i’m using the `.update()` function, I’m getting `HTTP 400, Okta E0000003 (The request body was not well-formed.)`.

So I must be missing something because if I’m parsing my object to a JSON String and send it with Postman I’m not getting any error and the app is updated.

But as there is no way to see the real json payload or request sent to Okta ( or if there is a way I didn’t find it), I’m kind of stuck here.

```auto
                    Application oidcApp = OIDCApplicationBuilder.instance()
                            .setName(name)
                            .setLabel(label)
                            .setGrantTypes(grantTypes)
                            .setResponseTypes(responseTypes)
                            .setApplicationType(applicationType)
                            .setTokenEndpointAuthMethod(authenticationMethod)
                            .setRedirectUris(redirectUris)
                            .buildAndCreate(okta);

                    oidcApp.put("status", status);
                    oidcApp.put("accessibility", accessibility);
                    oidcApp.put("visibility", visibility);
                    oidcApp.put("licensing", licensing);
                    oidcApp.put("features", features);
                    oidcApp.put("signOnMode", signOnMode);
                    oidcApp.put("credentials", credentials);
                    oidcApp.put("settings", settings);

                    Gson gson = new Gson();
                    String json = gson.toJson(oidcApp);
                    System.out.println(json);

                    oidcApp.update();

```

---

<div class="post-metadata">

**Author:** ![Lijia](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lijia/32/2295_2.png) [@Lijia](https://devforum.okta.com/u/Lijia)\
**Post date:** [October 4, 2021, 10:04pm UTC](https://devforum.okta.com/t/see-json-object-sent-by-okta-sdk-java-on-update/16439/2 "2021-10-04T22:04:25Z")

</div>

@Hekmil Did you test the operation in Postman? The below doc contains the samples to update an application. You may follow the example and test in postman first.  
[https://developer.okta.com/docs/reference/api/apps/#update-key-credential-for-application](https://developer.okta.com/docs/reference/api/apps/#update-key-credential-for-application)

---

<div class="post-metadata">

**Author:** ![Hekmil](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@Hekmil](https://devforum.okta.com/u/Hekmil)\
**Post date:** [October 5, 2021, 7:11am UTC](https://devforum.okta.com/t/see-json-object-sent-by-okta-sdk-java-on-update/16439/3 "2021-10-05T07:11:48Z")

</div>

As I said, yes I tried it with postman with my object converted to a JSON string and it worked.

`String json = gson.toJson(oidcApp);`

---

<div class="post-metadata">

**Author:** ![Hekmil](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@Hekmil](https://devforum.okta.com/u/Hekmil)\
**Post date:** [October 6, 2021, 7:50am UTC](https://devforum.okta.com/t/see-json-object-sent-by-okta-sdk-java-on-update/16439/4 "2021-10-06T07:50:08Z")

</div>

It means that `.update()` is doing more that it seems but as we can’t change client after defining the `Application` object I cannot intercept the payload to see what happened

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 8, 2024, 7:40pm UTC](https://devforum.okta.com/t/see-json-object-sent-by-okta-sdk-java-on-update/16439/5 "2024-02-08T19:40:29Z")

</div>


