Usage

Use CreateContact to add one or more contacts to your Cvent account data. The CreateContact call is analogous to the INSERT statement in SQL.

Basic Steps

  1. Create an instance of one or more individual contact objects. For each contact object, you populate its fields with the data you want to add.
  2. Construct a Contact array and populate that array with the contacts you want to create.
  3. Optionally, specify the MessageId if you need to track the result of each record. Message IDs can represent unique identifiers from your system. Message IDs will be returned as Reference IDs in the result array for your tracking purposes.
  4. Call CreateContact, passing in the Contact array.
  5. Process the results in the CreateContactResultArray object to verify whether the contacts have been successfully created.

General Syntax

CreateContactResultArray = cventapi.CreateContact(ContactArray)

Input

NameTypeDescription
ContactsContact ArrayArray of one or more contacts (up to 200) to create, and optionally MessageIds which will be returned as ReferenceIds. The Cvent Web service creates these contacts in array index order.

Output

NameTypeDescription
IdIDID of the user that you attempted to create. If this field contains a value, then the user was created successfully. If this field is empty, then the user was not created and the Cvent Web service returned error information instead.
ReferenceIdIDThe MessageId value in the input CvObject.
SourceIdStringSource ID of the contact. If this field contains a value, a source ID was sent in along with the contact’s other values. If the field is empty, then no source ID was supplied in the original call.
SuccessBooleanIndicates whether the Create call succeeded (True) or not (False) for this object.
ErrorsError ArrayIf an error occurred during the Create call, an array of one or more Error objects providing the error code and description.

Validation Rules

Validation RuleDescription
Format and PatternThe ID field should be a valid GUID data type. Email addresses should be in a valid email address format.
UniquenessThe application will generate a DupMatchKey from your Match Key fields and a new contact stub for each contact record. Your Match Key fields are either email address only or email address, last name, and company. The generated DupMatchKey will need to be unique within the input array and your account’s contact records. If a contact’s generated DupMatchKey is not unique, the contact creation result should be marked as failed and return the “Duplicated Contact Object – Key field(s) are not unique” error. If the contact does exist in your account, all instances of the contact in the input array will return error messages. If the contact does not exist in your account, the first instance of the contact in the input array will succeed. All subsequent instances will return an error message.
Referential IntegrityThe following relationships need to be valid to ensure database referential integrity: ContactTypeCode CountryCode StateCode
LengthThe application will truncate data which exceeds the maximum length of a field.
Read-OnlyThe application will ignore the value in the read-only fields.

Notes

Take into account the following notes when using the CreateContact call:

  • Permissions: Your client application must be logged in with sufficient access rights to create contacts within the account.
  • Automatically Maintained Fields: The Cvent Web service generates unique values for ID fields automatically. For example, for Create you cannot explicitly specify an ID value for a contact. The CreateContactResult array contains the ID of each contact that was successfully created.
  • Default Values: Certain fields have a default value. If you do not specify a value for such fields, the Cvent Web service populates these fields with the default value. For required fields that do not have a preconfigured default value, you must supply a value.
  • Required Fields: For required fields that do not have a preconfigured default value, you must supply a value.
  • Valid Data Values: You must supply values that are valid for the field’s data type, such as integers (not alphabetic characters) for integer fields. In your client application, follow the data formatting rules specified for your programming language and development tool. Your development tool will handle the appropriate mapping of data types in SOAP messages.
  • String Values: When storing values in string fields, the Cvent Web service trims any leading and trailing whitespace. For example, if the value of a name field is entered as “XYZ Company”, then the value is stored in the database as “XYZ Company”.
  • Maximum Number of Contacts Created: You can add up to 200 individual contacts in a single create call. If a create request exceeds 200 contacts, then the entire operation fails.
Last updated on