Quick start with sample code

 

Applies To: Dynamics Marketing

Use the code samples available with Microsoft Dynamics Marketing SDK package to get a demonstration of how to work with Microsoft Dynamics Marketing entities. More information: Sample code

Note

The code samples use shared helper code to perform common tasks, for example SAS and ACS authentication with the Service Bus queues. The helper code, which you might find useful in your applications, is available in the following folder in the SDK package: Samples\CS\Client.

For more information about running the samples, see the Readme file that is available with each sample code.

Build and run the samples

In the Samples/CS folder of the SDK download you will find a folder for each sample and an associated Readme file. The Readme file contains information about how to build and run the sample.

Next Steps

After running the program, select the options from the menu. Depending on the sample code you choose to run, the menu options will differ.

Sample code

Options

Demonstrates

Sample: Create and update external entities

Create or update external entity

CreateOrUpdateExternalEntityRequest class and CreateOrUpdateExternalEntityResponse class.

Retrieve entity

RetrieveExternalEntityRequest class and RetrieveExternalEntityResponse class.

Retrieve entity types

RetrieveExternalEntityTypesRequest class and RetrieveExternalEntityTypesResponse class.

Retrieve entity IDs

RetrieveExternalIdsRequest class and RetrieveExternalIdsResponse class.

Delete single entity

DeleteExternalEntityRequest class and DeleteExternalEntityResponse class.

Delete category

DeleteExternalEntityTypeRequest class and DeleteExternalEntityTypeResponse class.

Sample: Create, read, and update a category

Create/Update user-defined categories

CreateOrUpdateCustomFieldCategoriesRequest class and CreateOrUpdateCustomFieldCategoriesResponse class.

Sample: Create, read, update, and delete a company (including UDF custom fields)

Retrieve a company

RetrieveCompanyRequest class and RetrieveCompanyResponse class.

Create a company

CreateOrUpdateCompanyRequest class and CreateOrUpdateCompanyResponse class.

Update a company

CreateOrUpdateCompanyRequest class and CreateOrUpdateCompanyResponse class.

Delete a company

DeleteCompanyRequest class and DeleteCompanyResponse class.

Retrieve multiple companies

RetrieveCompaniesRequest class and RetrieveCompaniesResponseclass.

Sample: Create, read, update, and delete contact (including custom fields)

Retrieve a contact

RetrieveContactRequest class and RetrieveContactResponse class.

Create a contact

CreateOrUpdateContactRequest class and CreateOrUpdateContactResponse class.

Update a contact

CreateOrUpdateContactRequest class and CreateOrUpdateContactResponse class.

Delete a contact

DeleteContactRequest class and DeleteContactResponse class.

Retrieve a list of salutations

RetrieveSalutationsRequest class and RetrieveSalutationsResponse class.

Retrieve a list of currencies

RetrieveCurrenciesRequest class RetrieveCurrenciesResponse class.

Retrieve a list of languages

RetrieveLanguagesRequest class and RetrieveLanguagesResponse class.

Retrieve multiple contacts

RetrieveContactsRequest class and RetrieveContactsResponse class.

Create multiple contacts

CreateOrUpdateContactsRequest class and CreateOrUpdateContactsResponse class.

Sample: Create, read, update, and cancel event attendance

Retrieve an event attendance

RetrieveEventAttendanceRequest class and RetrieveEventAttendanceResponse class.

Create an event attendance

CreateOrUpdateEventAttendanceRequest class and CreateOrUpdateEventAttendanceResponse class.

Update an event attendance

CreateOrUpdateEventAttendanceRequest class and CreateOrUpdateEventAttendanceResponse class.

Cancel an event attendance

CancelEventAttendanceRequest class and CancelEventAttendanceResponse class.

Retrieve a list of event attendance statuses

RetrieveEventAttendanceStatusesRequest class and RetrieveEventAttendanceStatusesResponse class.

Sample: Create, read, update, and cancel event registration

Retrieve an event registration

RetrieveEventRegistrationRequest class and RetrieveEventRegistrationResponse class.

Create an event registration

CreateOrUpdateEventRegistrationRequest class and CreateOrUpdateEventRegistrationResponse class.

Update an event registration

CreateOrUpdateEventRegistrationRequest class and CreateOrUpdateEventRegistrationResponse class.

Cancel an event registration

CancelEventRegistrationRequest class and CancelEventRegistrationResponse class.

Sample: Create, read, update, and delete lead (including UDF custom fields)

Retrieve a lead

RetrieveLeadRequest class and RetrieveLeadResponse class.

Create a lead

CreateOrUpdateLeadRequest class and CreateOrUpdateLeadResponse class.

Update a lead

CreateOrUpdateLeadRequest class and CreateOrUpdateLeadResponse class.

Delete a lead

DeleteLeadRequest class and DeleteLeadResponse class.

Retrieve a list of priorities

RetrieveLeadPrioritiesRequest class and RetrieveLeadPrioritiesResponse class.

Retrieve a list of statuses

RetrieveLeadStatusesRequest class and RetrieveLeadStatusesResponse class.

Retrieve a list of territories

RetrieveTerritoriesRequest class and RetrieveTerritoriesResponse class.

Retrieve a list of sales ratings

RetrieveSalesRatingsRequest class and RetrieveSalesRatingsResponse class.

Retrieve multiple leads

RetrieveLeadsRequest class and RetrieveLeadsResponse class.

Sample: Create, read, update, and delete marketing results

Retrieve a marketing result

RetrieveMarketingResultRequest class and RetrieveMarketingResultResponse class.

Create a marketing result

CreateOrUpdateMarketingResultRequest class and CreateOrUpdateMarketingResultResponse class.

Update a marketing result

CreateOrUpdateMarketingResultRequest class and CreateOrUpdateMarketingResultResponse class.

Delete a marketing result

DeleteMarketingResultRequest class and DeleteMarketingResultResponse class.

Retrieve a list of marketing result types

RetrieveMarketingResultTypesRequest class and RetrieveMarketingResultTypesResponse class.

Retrieve multiple marketing results

RetrieveMarketingResultsRequest class and RetrieveMarketingResultsResponse class.

Sample: Retrieve custom fields by Belongs-To company and entity

Retrieve custom fields

RetrieveCustomFieldsRequest class and RetrieveCustomFieldsResponse class.

Sample: Manage lists and send transactional or commercial email

Retrieve transaction email messages

RetrieveEmailMessagesRequest class and RetrieveEmailMessagesResponse class.

Retrieve commercial email messages

RetrieveCommercialEmailMessagesRequest class and RetrieveCommercialEmailMessagesResponse class.

Retrieve message schema for email message

RetrieveMessageSchemaForEmailMessageRequest class and RetrieveMessageSchemaForEmailMessageResponse class.

Send email message by email

SendEmailMessageByEmailRequest class and SendEmailMessageByEmailResponse class.

Send email message by ID

SendEmailMessageByIdRequest class and SendEmailMessageByIdResponse class.

Send commercial email message

SendCommercialEmailMessageByIdRequest class and SendCommercialEmailMessageByIdResponse class.

Retrieve email message sent status

RetrieveEmailMessageSentStatusRequest class and RetrieveEmailMessageSentStatusResponse class.

Set contact permissions for an email address

SetContactPermissionsRequest class and SetContactPermissionsResponse class.

Set contact permissions for multiple email addresses

SetContactsPermissionsRequest class and SetContactsPermissionsResponse class.

Retrieve contact permissions for an email address

RetrieveContactPermissionsRequest class and RetrieveContactPermissionsResponse class.

Retrieve a list of email addresses for which contact permissions are missing

RetrieveEmailMessagesRequest class and RetrieveEmailMessagesResponse class.

Set email hard bounces to processed for a contact

SetEmailHardBouncesToProcessedForContactRequest class and SetEmailHardBouncesToProcessedForContactResponse class.

Retrieve unprocessed email hard bounces

RetrieveUnprocessedEmailHardBouncesRequest class and RetrieveUnprocessedEmailHardBouncesResponse class.

Sample: Work with marketing lists

Add contact to marketing list by email

AddContactToMarketingListByEmailRequest class and AddContactsToMarketingListByEmailsResponse class.

Add contacts to marketing lists by emails

AddContactsToMarketingListByEmailsRequest class and AddContactsToMarketingListByEmailsResponse class.

Add contact to marketing list by ID

AddContactToMarketingListByIdRequest class and AddContactToMarketingListByIdResponse class.

Add contacts to marketing list by IDs

AddContactsToMarketingListByIdsRequest class and AddContactsToMarketingListByIdsResponse class.

Copy contacts from marketing list

CopyContactsFromMarketingListRequest class and CopyContactsFromMarketingListResponse class.

Copy query to marketing list

CopyQueryToMarketingListRequest class and CopyQueryToMarketingListResponse class.

Create marketing list

CreateMarketingListRequest class and CreateMarketingListResponse class.

Delete marketing list

DeleteMarketingListRequest class and DeleteMarketingListResponse class.

Remove all contacts from marketing list

RemoveAllContactsFromMarketingListRequest class and RemoveAllContactsFromMarketingListResponse class.

Remove all contacts from marketing list by email

RemoveContactFromMarketingListByEmailRequest class and RemoveContactFromMarketingListByEmailResponse class.

Remove contact from marketing list by ID

RemoveContactFromMarketingListByIdRequest class and RemoveContactFromMarketingListByIdResponse class.

Retrieve all lists

RetrieveAllListsRequest class and RetrieveAllListsResponse class.

Retrieve marketing list

RetrieveMarketingListRequest class and RetrieveMarketingListResponse class.

Retrieve marketing lists

RetrieveMarketingListsRequest class and RetrieveMarketingListsResponse class.

Update marketing list

UpdateMarketingListRequest class and UpdateMarketingListResponse class.

Sample: Retrieve landing page submissions

Retrieve a landing page submission

RetrieveSubmissionRequest class and RetrieveSubmissionResponse class.

See Also

Developer overview of Microsoft Dynamics Marketing
Getting started with the SDK
Sample code
Assembly included in the Microsoft Dynamics Marketing SDK
Web service and assembly reference