# Error when making requests to a neo4j API

**URL:** <https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377>\
**Category:** Help Hub\
**Tags:** authentication, development\
**Created:** [October 17, 2023, 1:44pm UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377 "2023-10-17T13:44:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhisar027](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@abhisar027](https://community.postman.com/u/abhisar027)\
**Post date:** [October 17, 2023, 1:44pm UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377/1 "2023-10-17T13:44:20Z")

</div>

Hello,

When I am trying to run the neo4j API , I am getting the given error. I have used the correct userid & password for Authorization. Can someone help me in fixing this.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/0/d/0d48679ff0bfc61e2dc30fa7caf904ac6debe5e7.png)

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [October 17, 2023, 1:50pm UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377/2 "2023-10-17T13:50:37Z")

</div>

Hey @abhisar027 👋

There’s very little information to go off here - Are there any more details around the implementation or how this should be handling that request.

The request is returning a 200 OK with that response, is that deemed an error? What should the response be?

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [October 17, 2023, 1:53pm UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377/3 "2023-10-17T13:53:39Z")

</div>

Your not getting an authorisation\authentication error.

It’s returning an “200 OK” status.

You don’t seem to have a body or any parameters set, so what are you actually sending to the API?

What are you expecting the response to return?

This looks like an issue with the API, or the data you are sending.

Without seeing the API specification, I doubt anyone here will be able to help unless they have specifically used that API.

---

<div class="post-metadata">

**Author:** ![abhisar027](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@abhisar027](https://community.postman.com/u/abhisar027)\
**Post date:** [October 17, 2023, 1:58pm UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377/4 "2023-10-17T13:58:21Z")

</div>

Hi Mike,

Thank you for responding. I am sending a simple query in body to check total number of nodes in the database.

Query:  
MATCH (n)

RETURN n

LIMIT 10

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [October 17, 2023, 2:03pm UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377/5 "2023-10-17T14:03:36Z")

</div>

Your example request does not appear to have a body.

It would usually show a green dot to show the tab has content.

The documentation for this API appears to be here.

[Query the database - HTTP API (neo4j.com)](https://neo4j.com/docs/http-api/current/query/)

As mentioned, you are not getting an authorization error, so I suspect the issue is with the body, which should be a JSON object showing the statements that you want to execute.

It also appears that a query request to the API should be a POST method, not GET.

Can you share your body tab please, so we can see the statement you have crafted?

---

<div class="post-metadata">

**Author:** ![abhisar027](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@abhisar027](https://community.postman.com/u/abhisar027)\
**Post date:** [October 17, 2023, 2:36pm UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377/6 "2023-10-17T14:36:46Z")

</div>

Here it is. I have used Post method

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/e/d/ed80aec087f669502cff5e9ebcfafccddbcb680e.png)

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [October 17, 2023, 3:08pm UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377/7 "2023-10-17T15:08:26Z")

</div>

That is not valid JSON and does not follow the examples shown in the API documentation.

Have another look at the example requests.

[Query the database - HTTP API (neo4j.com)](https://neo4j.com/docs/http-api/current/query/)

If you are new to Postman or API’s in general, I would suggest a visit to the Learning Centre.

[Overview | Postman Learning Center](https://learning.postman.com/docs/introduction/overview/)

Including the Postman Training links under “Other Resources”.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/3/b/3b763d56d66445f4c34eeb66c64631335559a741.png)

I would recommend the “Galaxy APIs 101” course first as it gets you used to the application features.

Then the “Galaxy Testing and Automation” course which teaches you how to assert the responses.

---

<div class="post-metadata">

**Author:** ![abhisar027](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@abhisar027](https://community.postman.com/u/abhisar027)\
**Post date:** [October 18, 2023, 6:25am UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377/8 "2023-10-18T06:25:16Z")

</div>

Mike, Its working fine now. Thank you so much

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [November 17, 2023, 6:25am UTC](https://community.postman.com/t/error-when-making-requests-to-a-neo4j-api/53377/9 "2023-11-17T06:25:27Z")

</div>

Closed on November 17, 2023, 6:25am UTC

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