# Help for adding items to collection/database from external app?

**URL:** <https://forum.wixstudio.com/t/help-for-adding-items-to-collection-database-from-external-app/63644>\
**Category:** Ask the community\
**Tags:** code, question, wix-studio\
**Created:** [October 17, 2024, 11:13am UTC](https://forum.wixstudio.com/t/help-for-adding-items-to-collection-database-from-external-app/63644 "2024-10-17T11:13:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alperoz49](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/alperoz49/32/19881_2.png) [@alperoz49](https://forum.wixstudio.com/u/alperoz49)\
**Post date:** [October 17, 2024, 11:13am UTC](https://forum.wixstudio.com/t/help-for-adding-items-to-collection-database-from-external-app/63644/1 "2024-10-17T11:13:44Z")

</div>

**Question:**  
Hey everyone, I don’t know much about coding but trying something simple with the help of AI… Adding names & scores to my collection/database via 3rd party tools (POST)

AI told me to create a backend “submitData.jsw”

```javascript
// submitData.jsw
import wixData from 'wix-data';

export function addScore(player, score) {
  return wixData.insert("ScoreData", { player, score });
}

```

Also http-functions.js

```javascript
// http-functions.js
import { ok, serverError } from 'wix-http-functions';
import { addScore } from 'backend/submitData.jsw';

export function post_addScore(request) {
  const { player, score } = request.query;
  if (player && score) {
    return addScore(player, parseInt(score))
      .then(() => ok({ "message": "Score added successfully!" }))
      .catch((error) => serverError({ "message": "Error adding score", "error": error }));
  } else {
    return serverError({ "message": "Missing player or score" });
  }
}

```

> and to test via POSTMAN
> 
> - **Enter the API URL:**
> - Set the URL to your Wix HTTP function. For example :
> 
> ```javascript
> https://yourdomain.com/_functions/addScore
> 
> ```
> 
> - **Add Query Parameters:**
> - In the **Params** tab, add the following key-value pairs:
> - `player`: Enter the player name (e.g., `JohnDoe`)
> - `score`: Enter the score (e.g., `100`)

I get 500 Internal Errors  
and last time I tested I also got this  
`x-wix-function-user-error` header missing exception

I thought it could be related to Oath but I could not manage to resolve it.

my database access is public, everyone can add

How can I add data to my collection with no authentication using post commands?  
I have a game and using POST command I will add “player” & “score” that’s all I wanna do

**Product:**  
Wix Studio

**What are you trying to achieve:**  
Trying to add data to my collection with no authentication using post command.  
I have a game and using POST command I will add “player” & “score” to my database called “ScoreData” that’s all I wanna do

**What have you already tried:**  
tried many codes using backend function instructed by AI

**Additional information:**  
[Include any other pertinent details or information that might be helpful for people to know when trying to answer your question.]

---

<div class="post-metadata">

**Author:** ![Pratham](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/pratham/32/119586_2.png) [@Pratham](https://forum.wixstudio.com/u/Pratham)\
**Post date:** [October 17, 2024, 11:26am UTC](https://forum.wixstudio.com/t/help-for-adding-items-to-collection-database-from-external-app/63644/2 "2024-10-17T11:26:39Z")

</div>

Hey Alper,

This super informative tutorial by @thewixwiz will show you how to set up HTTP functions on your website:

[![](https://us1.discourse-cdn.com/wix/original/3X/7/7/77f952253a02ad6e8ca2f6746cee531b043509b8.jpeg "How to use Wix HTTP Functions") ](https://www.youtube.com/watch?v=jH48Gd102a4)

[![](https://us1.discourse-cdn.com/wix/original/3X/5/2/5285d25c90b576f080899019afc37bdf8b53bf3e.jpeg "How to Use HTTP Functions to Expose Your Site's API | Velo by Wix") ](https://www.youtube.com/watch?v=4yCBplV3MPQ)

---

<div class="post-metadata">

**Author:** ![alperoz49](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/alperoz49/32/19881_2.png) [@alperoz49](https://forum.wixstudio.com/u/alperoz49)\
**Post date:** [October 17, 2024, 11:50am UTC](https://forum.wixstudio.com/t/help-for-adding-items-to-collection-database-from-external-app/63644/3 "2024-10-17T11:50:32Z")

</div>

thank you for sharing these videos. Watching them

---

<div class="post-metadata">

**Author:** ![noahlovell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/noahlovell/32/118920_2.png) [@noahlovell](https://forum.wixstudio.com/u/noahlovell)\
**Post date:** [October 17, 2024, 12:42pm UTC](https://forum.wixstudio.com/t/help-for-adding-items-to-collection-database-from-external-app/63644/4 "2024-10-17T12:42:24Z")

</div>

Love these examples @Pratham 🙌

@alperoz49 let us know how you get on and if you find a solution 🙂

* * *

Side not, `.web.js` files are now used in favour of `.jsw` files in the backend - although it’s a more recent change, and I imagine most AI tools aren’t aware of this. Docs about it [here](https://dev.wix.com/docs/velo/api-reference/wix-web-module/introduction) if it’s any help 💪
