In my post Eloqua API How To: Submit A Form, the code assumes that you already know the ID of the Form that you are trying to submit.

 

But what if you don't already know this ID, or which fields are required in order to successfully submit the form?

 

Well, that's where the DescribeEntityType and DescribeEntity calls come in.

 

The DescribeEntityType operation is used to list all of the entities available in the system.  The following snippet will return all of the Forms for an Eloqua install:

 

 

 

 

// Set up the Eloqua API Service

EloquaServiceClient service = new EloquaServiceClient();

 

service.ClientCredentials.UserName.UserName = "Company\\User";

service.ClientCredentials.UserName.Password = "Password";

 

 

   // Execute the request

    DescribeEntityTypeResult result = service.DescribeEntityType("Form");

 

 

 

   // Extract the ID and Name of all Form EntityTypes

    foreach (EntityType entityType in result.EntityTypes)

    {

        Console.WriteLine(String.Format("ID: {0}", entityType.ID));

        Console.WriteLine(String.Format("Name: {0}", entityType.Name));

    }


With the returned data, you can locate your Form, and it's corresponding ID, to use for the submit.

 

The DescribeEntity operation is used to list the properties and field metadata of a DynamicEntity.  With this call,  you can determine which fields are required in order to submit a form.

 

See Eloqua API How To: Retrieve Entity Metadata for an example of it's usage.  In that code, you would use Form as the EntityType instead of Contact.

 

Using these operations, you'll be able to gather the information needed to work successfully with entities.