# Failing to create collection from REST API

**URL:** <https://community.weweb.io/t/failing-to-create-collection-from-rest-api/4022>\
**Category:** Ask us anything\
**Tags:** collection-page\
**Created:** [August 25, 2023, 12:35pm UTC](https://community.weweb.io/t/failing-to-create-collection-from-rest-api/4022 "2023-08-25T12:35:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![takutitus](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@takutitus](https://community.weweb.io/u/takutitus)\
**Post date:** [August 25, 2023, 12:35pm UTC](https://community.weweb.io/t/failing-to-create-collection-from-rest-api/4022/1 "2023-08-25T12:35:15Z")

</div>

I’m trying to create a collection from a REST API endpoint. I keep getting the error message “Cannot read properties of null (reading ‘reduce’)”.

In Postman i am able to successfully fetch data from my endpoint without any hiccups, in the weweb workflow editor, a REST API request successfully returns my data. The problem is in creating a collection using REST API as the source.

![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/49894c3cf38a933444d61112aa8fc8e7595186c6.png)

---

<div class="post-metadata">

**Author:** ![Quentin](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/quentin/32/6_2.png) [@Quentin](https://community.weweb.io/u/Quentin)\
**Post date:** [August 25, 2023, 12:54pm UTC](https://community.weweb.io/t/failing-to-create-collection-from-rest-api/4022/2 "2023-08-25T12:54:51Z")

</div>

Did you try making the request from a server (by toggling the option in the collection)? Pretty sure the API you’re using prevents CORS from browsers.

---

<div class="post-metadata">

**Author:** ![takutitus](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@takutitus](https://community.weweb.io/u/takutitus)\
**Post date:** [August 25, 2023, 1:11pm UTC](https://community.weweb.io/t/failing-to-create-collection-from-rest-api/4022/3 "2023-08-25T13:11:13Z")

</div>

Hie @Quentin , yes I am actually making the request from server.

---

<div class="post-metadata">

**Author:** ![Quentin](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/quentin/32/6_2.png) [@Quentin](https://community.weweb.io/u/Quentin)\
**Post date:** [August 25, 2023, 1:23pm UTC](https://community.weweb.io/t/failing-to-create-collection-from-rest-api/4022/4 "2023-08-25T13:23:00Z")

</div>

Could you take a screenshot or a video of the whole config of the API call? It’s kinda hard to debug with just the error. Thanks

---

<div class="post-metadata">

**Author:** ![takutitus](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@takutitus](https://community.weweb.io/u/takutitus)\
**Post date:** [August 25, 2023, 1:34pm UTC](https://community.weweb.io/t/failing-to-create-collection-from-rest-api/4022/5 "2023-08-25T13:34:06Z")

</div>

Sure,  
This is the API configurations.

 ![Screenshot 2023-08-25 152944](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/7f60a9b2e72e13741a38b3d6b3454c24258a2d65.png)

Thanks for assisting 🙂

---

<div class="post-metadata">

**Author:** ![Quentin](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/quentin/32/6_2.png) [@Quentin](https://community.weweb.io/u/Quentin)\
**Post date:** [August 25, 2023, 1:57pm UTC](https://community.weweb.io/t/failing-to-create-collection-from-rest-api/4022/6 "2023-08-25T13:57:10Z")

</div>

Ok, the API call seems legit to me.

Then, could you file a bug report on [support.weweb.io](http://support.weweb.io)? We’ll double-check if it’s not a WeWeb-related issue.

Sorry for the trouble 🙏

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [August 25, 2023, 4:11pm UTC](https://community.weweb.io/t/failing-to-create-collection-from-rest-api/4022/7 "2023-08-25T16:11:23Z")

</div>

Hi @takutitus 👋

Just had a look at your project.

WeWeb doesn’t accept REST API calls on `http`. REST API requests made through our plugin need to be `https`
