# Cannot access diffdock API using acces token

**URL:** <https://forums.developer.nvidia.com/t/cannot-access-diffdock-api-using-acces-token/311853>\
**Category:** Access/Accounts\
**Tags:** diffdock, nim\
**Created:** [October 31, 2024, 10:12pm UTC](https://forums.developer.nvidia.com/t/cannot-access-diffdock-api-using-acces-token/311853 "2024-10-31T22:12:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nishanth.merwin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nishanth.merwin](https://forums.developer.nvidia.com/u/nishanth.merwin)\
**Post date:** [October 31, 2024, 10:12pm UTC](https://forums.developer.nvidia.com/t/cannot-access-diffdock-api-using-acces-token/311853/1 "2024-10-31T22:12:34Z")

</div>

I’m currently trying to access the diffdock API but am running into an issue where I cannot authenticate using my access key.

Here is a short example for what I am trying:

```auto
$ curl "https://health.api.nvidia.com/v1/biology/mit/diffdock" -X POST -H "Authorization: Bearer nvapi-ADSA....[truncated]"

{"status":401,"title":"Unauthorized","detail":"Invalid JWT serialization: Missing dot delimiter(s)"}%

```

It seems like this endpoint is looking for a JWT, not an access token? Let me know if I’m doing anything wrong in accessing this endpoint, I’m trying to follow the instructions outlined here:

> **[Molecular Docking Pose Generation](https://docs.api.nvidia.com/nim/reference/mit-diffdock-infer)**
>
> Predict molecular docking

> **[diffdock model by mit | NVIDIA NIM](https://build.nvidia.com/mit/diffdock)**
>
> Predicts the 3D structure of how a molecule interacts with a protein.

I also tried this via the instructions outlined here: [NIM embedding model downloads but fails with auth error on startup - #6 by joe173](https://forums.developer.nvidia.com/t/nim-embedding-model-downloads-but-fails-with-auth-error-on-startup/303301/6)

This also failed with the same JWT error.

---

<div class="post-metadata">

**Author:** ![nishanth.merwin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nishanth.merwin](https://forums.developer.nvidia.com/u/nishanth.merwin)\
**Post date:** [November 8, 2024, 7:21pm UTC](https://forums.developer.nvidia.com/t/cannot-access-diffdock-api-using-acces-token/311853/4 "2024-11-08T19:21:21Z")

</div>

I’m not sure what changed, but the exact same request now succeeds. Thank you for everyone that reviewed this issue, the DiffDock NIM API is working great!

---

<div class="post-metadata">

**Author:** ![Kris.NV](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kris.nv/32/14047_2.png) [@Kris.NV](https://forums.developer.nvidia.com/u/Kris.NV)\
**Post date:** [November 8, 2024, 7:51pm UTC](https://forums.developer.nvidia.com/t/cannot-access-diffdock-api-using-acces-token/311853/5 "2024-11-08T19:51:02Z")

</div>

Thanks for following up, and glad to hear that it’s now working!

It’s possible it was a transient auth issue. It’s also important to include full headers. In the DiffDock example on [build.nvidia.com](http://build.nvidia.com) ([diffdock model by mit | NVIDIA NIM](https://build.nvidia.com/mit/diffdock?snippet_tab=Shell)) this is done as follows:

```auto
authorization_header='Authorization: Bearer $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC'
accept_header='Accept: application/json'
content_type_header='Content-Type: application/json'

```

And included in the curl request as:

```auto
response=$(curl --silent --request POST \
  --url "$invoke_url" \
  --header "$authorization_header" \
  --header "$accept_header" \
  --header "$content_type_header" \
...

```

Please let us know if you run into any additional issues!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [November 22, 2024, 7:51pm UTC](https://forums.developer.nvidia.com/t/cannot-access-diffdock-api-using-acces-token/311853/6 "2024-11-22T19:51:20Z")

</div>

Closed on November 22, 2024, 7:51pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
