# Help accessing API

**URL:** <https://forum.knime.com/t/help-accessing-api/78741>\
**Category:** KNIME Analytics Platform\
**Created:** [April 24, 2024, 2:02pm UTC](https://forum.knime.com/t/help-accessing-api/78741 "2024-04-24T14:02:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike4](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/aeb1de/32.png) [@mike4](https://forum.knime.com/u/mike4)\
**Post date:** [April 24, 2024, 2:02pm UTC](https://forum.knime.com/t/help-accessing-api/78741/1 "2024-04-24T14:02:46Z")

</div>

Good morning!

I am hoping someone can help me access this API to generate a bearer token: [fileField (follettcommunity.com)](https://www.follettcommunity.com/servlet/fileField?entityId=ka02J000000HnhmQAC&field=DescriptionFile __Body__ s)

I am able to access it via Postman with a key and secret via a Post call and I get a Bearer Token returned. However, I am having trouble with this in Knime and am getting a 415 error in return.

I have set up a Post with this Header.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/7/0/704d91daf011753005169f1afb1db2c3cb346efe.png)

Here is the Bosy of the Post.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/b/4/b419c6f20d87a02224bca054a934f464e8d791f5.png)

Here is the Connection Tab.  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/e/d/ed24737d4880ca957102a6dac3cdbafc86bf5ead.png)

I will be grateful for any help that can be provided.

Thank you,  
Michael

---

<div class="post-metadata">

**Author:** ![mwiegand](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mwiegand/32/66896_2.png) [@mwiegand](https://forum.knime.com/u/mwiegand)\
**Post date:** [April 25, 2024, 12:09pm UTC](https://forum.knime.com/t/help-accessing-api/78741/2 "2024-04-25T12:09:35Z")

</div>

Hi @mike4,

checking the response code 415:

> **[415 Unsupported Media Type - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415)**
>
> The HTTP 415 Unsupported Media Type client error response
> code indicates that the server refuses to accept the request because the payload format
> is in an unsupported format.

It hints towards a wrong response type being requested but I see you added the correct request header “Accept”. Eventually you must explicitly request “Accept: application/json; charset=utf-8”.

The POST Request node might also issue an HTTP 1.0 but not 1.1 request (just speculation) but that might result in a different error.

Best  
Mike

---

<div class="post-metadata">

**Author:** ![mike4](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/aeb1de/32.png) [@mike4](https://forum.knime.com/u/mike4)\
**Post date:** [April 25, 2024, 12:54pm UTC](https://forum.knime.com/t/help-accessing-api/78741/3 "2024-04-25T12:54:25Z")

</div>

Thank you so much for your response.

I added this to the request header.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/3/33bd9621e2b82d9e376eb4c1e659d430ff41ab24.png)

However, I am still getting a 415 error. I’d love to try any other ideas that you might have.

Best,

Michael

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [April 25, 2024, 4:29pm UTC](https://forum.knime.com/t/help-accessing-api/78741/4 "2024-04-25T16:29:51Z")

</div>

@mike4  
are you sure you using the right Content-Type and it shouldn’t be

```auto
Content-Type: application/json'

```

instead?  
br

---

<div class="post-metadata">

**Author:** ![mike4](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/aeb1de/32.png) [@mike4](https://forum.knime.com/u/mike4)\
**Post date:** [April 25, 2024, 4:49pm UTC](https://forum.knime.com/t/help-accessing-api/78741/5 "2024-04-25T16:49:38Z")

</div>

Thank you, Daniel.

Unfortunately, that is still yielding me a 415 error.

If it helps, I am posting an image of the headers and body from Postman that do work.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/1/b/1b7f54da9babf6640b342597bcffe2ba6add6760.png)

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/6/f/6f8ed7ca1e09d7c35a9a4cad4d94ae96feb7f26f.png)

I’d appreciate any more ideas that this amazing community has!

Best,

Michael

---

<div class="post-metadata">

**Author:** ![mike4](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/aeb1de/32.png) [@mike4](https://forum.knime.com/u/mike4)\
**Post date:** [April 25, 2024, 4:51pm UTC](https://forum.knime.com/t/help-accessing-api/78741/6 "2024-04-25T16:51:32Z")

</div>

I will add I also tried changing my Header in Knime for Accept to _/_ and added a header for Accept-Encoding, but each time received a 415 error.

Thank you, all!

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 27, 2024, 7:47am UTC](https://forum.knime.com/t/help-accessing-api/78741/7 "2024-04-27T07:47:20Z")

</div>

Hi @mike4, are you able to make use of this at all, to handle the request?

> [@PUT Request application/x-www-form-urlencoded](https://forum.knime.com/t/put-request-application-x-www-form-urlencoded/38627/2):
>
> Hi, you’ll need to encode the request body as “form encoded”. In [Palladian](https://nodepit.com/product/palladian), there’s a node which allows you to conveniently create the necessary structure which you can then use with the [HTTP Retriever](https://nodepit.com/node/ws.palladian.nodes.retrieval.HttpRetrieverNodeFactory2): HTH, Philipp

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [July 26, 2024, 7:48am UTC](https://forum.knime.com/t/help-accessing-api/78741/8 "2024-07-26T07:48:07Z")

</div>

Closed on July 26, 2024, 7:48am UTC

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