2

I am using the php Fuel SDK to create new folders and populate them with images.

/**
 * @return mixed
 */
function createFolder() {
  $client = getAuth();

  // Create Folder
  $postFolder = new ET_Folder();
  $postFolder->authStub = $client;
  // Folder setup
  $postFolder->props = array(
    "CustomerKey" => "image_storage",
    "Name" => "Image Storage",
    "Description" => "Image Storage",
    "ContentType"=> "Media",
    "ParentFolder" => array(
      "ID" => 0
    ),
    "AllowChildren" => "true",
    "IsEditable" => "true"
  );

  //post
  $postResult = $postFolder->post();
  return $postResult->results;
}

The issue i'm having is that every time this function is triggered i get an error message ($ET_post->0['StatusMessage']): An unknown error occured while processing. Error ID:........

enter image description here

does anyone have any idea what would cause this?

0

My situation is somewhat different (I am using the SOAP API), but adding a comment as it might help others. I had gotten the same cryptic error message when trying to create a datafolder without providing a value for the "description" property. So make sure any datafolders you create have a description field (although I see in your case that you provided it.)

For Java (Apache CXF) based code, here is a sample:

    try {
        //Create PartnerAPI stub.
        PartnerAPI service = new PartnerAPI();
        Soap stub = service.getSoap();

        // Apache CXF-specific: if desired to see SOAP messages in console while running
        // Note logging credentials will be readable in the SOAP request if done
        Client client = ClientProxy.getClient(stub);
        client.getInInterceptors().add(new LoggingInInterceptor());
        client.getOutInterceptors().add(new LoggingOutInterceptor());

        // used to specify BU for folder
        ClientID clientID = new ClientID();
        clientID.setID(xxxxxx); // MID value of the BU where you are adding the folder

        DataFolder parentFolder = new DataFolder();
        parentFolder.setID(xxxxxx);  // category ID of "My Emails" folder or other parent folder desired

        DataFolder df = new DataFolder();
        df.setClient(clientID);
        df.setParentFolder(parentFolder);
        df.setName("GlenFolder2");
        df.setDescription("GlenFolder desc");
        df.setContentType("Email");
        df.setIsEditable(true);
        df.setAllowChildren(true);

        CreateRequest cr = new CreateRequest();
        cr.getObjects().add(df);
        cr.setOptions(new CreateOptions());

        CreateResponse response = stub.create(cr);
        for (CreateResult result : response.getResults()) {
            System.out.println("Result = " + result.getStatusCode() + " " + result.getStatusMessage());
        }

        System.out.println("Overall status = " + response.getOverallStatus());
    } catch (Exception e) {
        e.printStackTrace();
    }

Possible DataFolder contentType values are defined here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.