2

So far i have been using SSJS and/or AMP script for Landing pages and others in Exacttarget. Am just wondering, how can i use C#/.net to do the same instead? How? where do you put it ? Dont mind if i being sounded stupid ..would appreciate the pointers...Any example(creating a record in DE) or sth can help me try with an example to get an idea..

i followed the link to connect to ET API using VS 2010 : http://etcentric.com/2010/08/03/connecting-to-the-et-api-using-visual-studio-2008-c-and-wcf/

1

Currently, the developer documentation for Fuel APIs are in one of two place -

  1. Help.Exacttarget.com
  2. Code.Exacttarget.com

There are SOAP and REST APIs in Fuel, and have some great technology backing them up.

There is a C# Client Library available as well, and creating a data extension with that library would look like this -

private void CreateDE()
        {
            SoapClient ETClient = new SoapClient();
            ETClient.ClientCredentials.UserName.UserName = "X";
            ETClient.ClientCredentials.UserName.Password = "X";

            DataExtension de = new DataExtension();
            de.Name = "API Created Data Extension";
            de.CustomerKey = "API Created Data Extension";
            de.IsSendable = true;
            de.IsSendableSpecified = true;
            de.SendableDataExtensionField = new DataExtensionField();
            de.SendableDataExtensionField.Name = "EMAIL";
            de.SendableSubscriberField = new ExactTargetClient.Attribute();            
            de.SendableSubscriberField.Name = "Email Address";
            List<DataExtensionField> fields = new List<DataExtensionField>();

            //Create the Primary Key field named EMAIL
            DataExtensionField field = new DataExtensionField();
            field.Name = "EMAIL";
            field.FieldType = DataExtensionFieldType.EmailAddress;
            field.FieldTypeSpecified = true;
            field.IsRequired = true;
            field.IsRequiredSpecified = true;
            field.IsPrimaryKey = true;
            field.IsPrimaryKeySpecified = true;
            fields.Add(field);

            // Create a field for first name 
            field = new DataExtensionField();
            field.Name = "FIRST NAME";
            field.FieldType = DataExtensionFieldType.Text;
            field.FieldTypeSpecified = true;
            fields.Add(field);

            // Create a field for first name 
            field = new DataExtensionField();
            field.Name = "LAST NAME";
            field.FieldType = DataExtensionFieldType.Text;
            field.FieldTypeSpecified = true;
            fields.Add(field);

            de.Fields = fields.ToArray();

            string sStatus = "";
            string sRequestId = "";

            CreateResult[] aoResults = ETClient.Create(new CreateOptions(), new APIObject[] { de }, out sRequestId, out sStatus);
            Console.WriteLine("Status: " + sStatus);
            Console.WriteLine("Request ID: " + sRequestId);
        }

There are plenty of samples in the C# repo as well you can check out.

Hope this helps!

|improve this answer|||||
  • 1
    Kelly is right on, if you want to do API calls. BUT, landing pages are NOT server pages, so I'm not sure what Kelly is saying will help you. Like, they are not ASPX pages. The code Kelly posted would be run externally to ET, calling into ET, You can do some stuff and landing pages with SSJS and AMPScript and AJAX GET calls to external pages, but that is the limit of the server page functionality. – Timothy Jun 6 '14 at 13:59

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.