Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools MailChimp API MailChimp API Adding New Members to Your List

Tim van der Zouwen
Tim van der Zouwen
7,393 Points

How to get files from a folder?

I want to GET the files from a folder I created in Mailchimp. With the endpoint "file-manager/folders" I can display my folders.

After finding my folder ID I want to fetch the files from that folder with the endpoint "file-manager/folders/9999/" I receive a name and file_count

With that checked I want to receive the files from that folder with the endpoint "file-manager/folders/9999/files" but here is where I end up with the following error:

The resource 'GalleryFolder_files_collection' could not be found.

Is there something wrong with my request or is it something else?

3 Answers

Nate Ranson
STAFF
Nate Ranson
Treehouse Guest Teacher

Hey Tim --

That looks like something may be wrong on our end of things. Would you mind reaching out to our API support team at apihelp [at] mailchimp [dot] com?

Thanks so much!

Tim van der Zouwen
Tim van der Zouwen
7,393 Points

Hey Nate,

Thank you for your quick response. I will send the question above to the API support team.

I will let you know what their response is.

Tim van der Zouwen
Tim van der Zouwen
7,393 Points

Hey Nate,

This is what I got from mailchimp:

Hey there Tim,

Thanks for writing into us at MailChimp API support. That's quite an odd error for the provided curl request and I'll be happy to assist with that.

I did some testing and checking on our end, and it does seem like we're 404ing on valid requests to the endpoint. Because of this, I've gone ahead and opened a ticket with our developers to get a fix pushed out for that, though I wouldn't be able to provide an ETA on when that would be available.

To look at all of your files, you'll want to use the GET parameters count and offset so that you can page through the files. Count can be increased to return more results, though after it is increased enough, the request will eventually time out, so you'll have to page through results using the offset parameter to get any additional results afterwards. We have some more information on pagination in one of our docs available here: http://kb.mailchimp.com/api/article/api-3-overview

If you have any additional quiestions or concerns, please don't hesitate to get back in touch. We'll be happy to assist in any way we can.

Thank you, Lucas