# Unable to list children of FOLDER by API

**URL:** https://community.dremio.com/t/unable-to-list-children-of-folder-by-api/3715
**Category:** Uncategorized
**Created:** [July 19, 2019, 5:55pm UTC](https://community.dremio.com/t/unable-to-list-children-of-folder-by-api/3715 "2019-07-19T17:55:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tonio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/tonio/32/1680_2.png) [@tonio](https://community.dremio.com/u/tonio)
#### Post date: [July 19, 2019, 5:55pm UTC](https://community.dremio.com/t/unable-to-list-children-of-folder-by-api/3715/1 "2019-07-19T17:55:50Z")

</div>

I wanted to use the dremio api to create a PDS for each file of a folder inside my data source (S3).

This is what I did:

1. GET /catalog
  - response:

```auto
{'data': [{'id': 'YYYYYYYYYY',
   'path': ['@DremioAdmin'],
   'tag': '0',
   'type': 'CONTAINER',
   'containerType': 'HOME'},
  {'id': 'ZZZZZZZZZZ',
   'path': ['Space'],
   'tag': '0',
   'type': 'CONTAINER',
   'containerType': 'SPACE'},
  {'id': 'XXXXXXXXXX',
   'path': ['DremioS3Source'],
   'tag': '0',
   'type': 'CONTAINER',
   'containerType': 'SOURCE'}]}

```

1. grab source id (XXXXXXXXXX)
2. GET /catalog/XXXXXXXXXX
  - response (only the ‘children’ values):

```auto
{...
'children':[
{'id': 'dremio:/DremioS3Source/"JJJJJJJJJJ"',
  'path': ['DremioS3Source', '"JJJJJJJJJJ"'],
  'type': 'CONTAINER',
  'containerType': 'FOLDER'},
 {'id': 'dremio:/DremioS3Source/"KKKKKKKKKK"',
  'path': ['DremioS3Source','"KKKKKKKKKK"'],
  'type': 'CONTAINER',
  'containerType': 'FOLDER'}]
...}

```

1. grab folder id (‘dremio:/DremioS3Source/“KKKKKKKKKK”’)
2. GET /catalog/‘dremio:/DremioS3Source/“KKKKKKKKKK”’
  - response:

```auto
{'errorMessage': 'Something went wrong', 'moreInfo': 'HTTP 404 Not Found'}

```

* * *

So the problem is, i grab this really weird id from the ‘children’ of the data source (not like the other hashes), and when I request the using the catalog, nothing shows up.

Why is this happening?  
Are there any workarounds to it?

(BTW, I thought it was worth mentioning that this data source is not inside an S3 bucket, but on the root directory of my S3, so each folder inside the source is actually a bucket).

---

<div class="post-metadata">

### Author: ![doron](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/doron/32/294_2.png) [@doron](https://community.dremio.com/u/doron)
#### Post date: [July 19, 2019, 6:04pm UTC](https://community.dremio.com/t/unable-to-list-children-of-folder-by-api/3715/2 "2019-07-19T18:04:05Z")

</div>

@tonio

You most likely need to URL encode the ID to make it URL safe. For example, `dremio:/DremioS3Source/"KKKKKKKKKK"` becomes `dremio%3A%2FDremioS3Source%2F%22KKKKKKKKKK%22`

---

<div class="post-metadata">

### Author: ![tonio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/tonio/32/1680_2.png) [@tonio](https://community.dremio.com/u/tonio)
#### Post date: [July 19, 2019, 6:28pm UTC](https://community.dremio.com/t/unable-to-list-children-of-folder-by-api/3715/3 "2019-07-19T18:28:16Z")

</div>

Exactly that, thank you!
