Overview
  • Namespace
  • Class

Namespaces

  • MailChimp
    • AuthorizedApps
    • Automations
    • Batches
    • CampaignFolders
    • Campaigns
    • Conversations
    • Ecommerce
    • FileManager
    • Lists
    • Reports
    • TemplateFolders
    • Templates

Classes

  • MailChimp\AuthorizedApps\AuthorizedApps
  • MailChimp\Automations\Automations
  • MailChimp\Batches\Batches
  • MailChimp\CampaignFolders\CampaignFolders
  • MailChimp\Campaigns\Campaigns
  • MailChimp\Campaigns\Content
  • MailChimp\Campaigns\Feedback
  • MailChimp\Conversations\Conversations
  • MailChimp\Ecommerce\Carts
  • MailChimp\Ecommerce\Customers
  • MailChimp\Ecommerce\Ecommerce
  • MailChimp\Ecommerce\Orders
  • MailChimp\Ecommerce\Products
  • MailChimp\FileManager\Files
  • MailChimp\FileManager\Folders
  • MailChimp\Lists\Interests
  • MailChimp\Lists\Lists
  • MailChimp\Lists\Members
  • MailChimp\Lists\MergeFields
  • MailChimp\Lists\Segments
  • MailChimp\Lists\SignupForms
  • MailChimp\Lists\Webhooks
  • MailChimp\MailChimp
  • MailChimp\Reports\Reports
  • MailChimp\TemplateFolders\TemplateFolders
  • MailChimp\Templates\Templates
 1 <?php
 2 
 3 namespace MailChimp\FileManager;
 4 
 5 use MailChimp\MailChimp as MailChimp;
 6 
 7 class Folders extends MailChimp
 8 {
 9 
10     /**
11      * Get a list of all folders in the File Manager.
12      *
13      * Available query fields:
14      * array["fields"]              array       list of strings of response fields to return
15      * array["exclude_fields"]      array       list of strings of response fields to exclude (not to be used with "fields")
16      * array["count"]               int         number of records to return
17      * array["offset"]              int         number of records from a collection to skip.
18      * array["folder_id"]           int         Filter results by a specific campaign folder.
19      * array["created_by"]          string      The MailChimp account user who created the File Manager file.
20      * array["before_created_at"]   string      Restrict the response to files created before the set date
21      *                                          ISO 8601 time format: 2015-10-21T15:41:36+00:00.
22      * array["since_created_at"]    string      Restrict the response to files created after the set date.
23      *                                          ISO 8601 time format: 2015-10-21T15:41:36+00:00.
24      *
25      * @param array $query (See Above) OPTIONAL associative array of query parameters.
26      * @return object
27      */
28     public function getFolders(array $query = [])
29     {
30         return self::execute("GET", "file-manager/folders", $query);
31     }
32 
33     /**
34      * Get information about a specific folder in the File Manager.
35      *
36      * Available query fields:
37      * array["fields"]              array       list of strings of response fields to return
38      * array["exclude_fields"]      array       list of strings of response fields to exclude (not to be used with "fields")
39      *
40      * @param int file_id
41      * @param array $query (See Above) OPTIONAL associative array of query parameters.
42      * @return object
43      */
44     public function getFolder($folder_id, array $query = [])
45     {
46         return self::execute("GET", "file-manager/folders/{$folder_id}", $query);
47     }
48 
49     /**
50      * Create a new folder in the File Manager.
51      *
52      * @param string $name
53      * @return object
54      */
55     public function createFolder($name)
56     {
57         $data = [
58             "name" => $name,
59         ];
60 
61         return self::execute("POST", "file-manager/folders", $data);
62     }
63 
64     /**
65      * Update a File Manager Folder.
66      *
67      * @param string file_id
68      * @param array $data
69      */
70     public function updateFolder($folder_id, $name)
71     {
72         $data = [
73             "name" => $name,
74         ];
75 
76         return self::execute("PATCH", "file-manager/folders/{$folder_id}", $data);
77     }
78 
79     /**
80      * Delete a specific folder in the File Manager.
81      *
82      * @param int $folder_id
83      */
84     public function deleteFolder($folder_id)
85     {
86         return self::execute("DELETE", "file-manager/folders/{$folder_id}");
87     }
88 
89 }
90 
API documentation generated by ApiGen