Leads
Marketo の組織のリードを作成、更新、削除、クエリします。
テーブル固有の情報
Select
すべてのカラムは '=' 演算子を使って指定される必要があります。カラムがフィルタリング可能な場合、IN 演算子またはOR 論理演算子を使用して複数の値を指定します。
サーバーからの応答時間を最適化するために、取得したい行とカラムだけを指定します。
SELECT Id, FirstName, LastName FROM Leads WHERE Id IN (1, 2, 5, 10)
Marketo 内の既知のリードのリストに限定してクエリを実行すれば、このクエリで最高のパフォーマンスを得ることができます。このためには、Marketo 内でリードのスタティックリストを作成し、ListId を指定してそれらを取得します。
フィルタが指定されていない場合は、Activities_NewLead テーブルがクエリされ、Lead Id のリストが取得されます。Lead Id がコンパイルされた後、Leads テーブルにクエリを実行するために使用されます。 それぞれのLeads リクエストに対して1つのActivities_NewLead が発生するため、フィルタが指定されていない場合、リード1件あたりのAPI コール数は実質的に2倍になります。 これはクエリのパフォーマンスに影響します。
次に例を示します。
- 返されたリードを特定の期間に作成されたものに限定するには、'CreatedAt' カラムでフィルタリングします。'>' または'>=' 演算子を使用する場合、
Activities_NewLead テーブルリクエストにdatetime 値が含まれます。
REST API のリクエストごとの最大バッチサイズは300なので、このクエリが必要とするAPI コールの回数は、計算式を使って概算できます。
(Total Number of Leads / 300) * 2
- 返されたリードを特定の日付に更新されたものに限定するには、'UpdatedAt' カラムでフィルタリングします。'>' または'>=' 演算子を使用する場合、
Activities_LeadChanges テーブルリクエストにdatetime 値が含まれます。
REST API のリクエストごとの最大バッチサイズは300なので、このクエリが必要とするAPI コールの回数は、計算式を使って概算できます。
(Total Number of Leads / 300) * 2
SOAP API を使ってLead Id のリストを取得する方法として、Other プロパティでUseSOAPForLeadIds=True に設定する方法もあります。UseSOAPForLeadIDs がTrue でSOAP 接続の詳細が指定されている場合、SOAP API はLead Id のリストをコンパイルし、これがREST API のフィルタとして使用されます。
SOAP API はREST API と比べるとかなり遅いので、このハイブリッドアプローチはSOAP API を単独で使用するよりも処理が早くなります。SOAP API のリクエストごとの最大バッチサイズは1000なので、このクエリが必要とするAPI コールの回数は、計算式を使って概算できます。
(Total Number of Leads / 1000) + (Total Number of Leads / 300)
Insert
新しいLead レコードを作成するには、データベースに登録するリードの名、姓、E メールアドレス、会社名を指定します。
例えば、E メールアドレスが[email protected] であるJohn Mangel という人物の新しいリードを挿入するには、次のように入力します:
INSERT INTO Leads (Email, FirstName, LastName) VALUES ('[email protected]', 'John', 'Mangel')
#TEMP テーブルを介して複数のリードを一度に挿入するには、まず#TEMP テーブルを作成し、そのテーブルをLeads テーブルに挿入します。
次の例では、3つの新しいリードを持つ#TEMP テーブルを作成し、その#TEMP テーブルをLeads テーブルに挿入しています。
INSERT INTO Leads#TEMP (FirstName, LastName, Email, Company) VALUES ('John', 'Mangel', '[email protected]', 'ABC')
INSERT INTO Leads#TEMP (FirstName, LastName, Email, Company) VALUES ('Steve', 'Puth', '[email protected]', 'ABC')
INSERT INTO Leads#TEMP (FirstName, LastName, Email, Company) VALUES ('Andrew', 'Stack', 'andy@abc', 'ABC')
INSERT INTO Leads (FirstName, LastName, Email, Company) SELECT FirstName, LastName, Email, Company FROM Leads#TEMP
CSV ファイルから複数のリードをインポートするには、UseBulkAPI がTrue に設定されていることを確認し、以下のようなコマンドを入力します。
INSERT INTO Leads (CSVFile) VALUES ('C:\\\\Upload\\\\ImportLeads.csv')
Update
Leads テーブルのread-only でない項目はすべて更新が可能です。更新は、ルックアップフィールド(外部キー)として、Email などの'Filterable' カラムを使用して実行されます。 (Leads テーブルのすべてのReadOnly およびFilterable カラムを確認するには、以下の「カラム」を参照してください。)
次に例を示します。
- Id=1(Id はルックアップフィールド)であるすべての行に、111-222-3333 をMobilePhone 項目として割り当てるようにLeads テーブルを更新します。
UPDATE Leads SET MobilePhone = '111-222-3333' WHERE Id = 1
- [email protected](Email はルックアップフィールド)であるすべての行に、111-222-3333 をMobilePhone 項目として割り当てるようにLeads テーブルを更新します。
UPDATE Leads SET MobilePhone = '111-222-3333' WHERE Email = '[email protected]'
カスタムフィールドをルックアップフィールドとして使用することもできます。これを行うには、まずLookupField をカスタムフィールドとして定義することで、カスタムフィールドがこの方法で使用されることを明確に識別する必要があります。
例として、MyCustomField=my value(MyCustomField はルックアップフィールド)であるすべての行に、111-222-3333 をMobilePhone 項目として割り当てます。
UPDATE Leads SET MobilePhone = '111-222-3333' WHERE LookupField = 'MyCustomField' AND MyCustomField = 'my_value'
Delete
Leads テーブルからリードを削除するには、そのリードをMarketo Id で識別する必要があります。たとえば、Marketo Id=1 のリードを削除するには、次のように入力します。
DELETE FROM Leads WHERE Id = 1
GetDeleted
過去14日間にLeads テーブルから削除されたすべてのリードのリストを取得するには、GetDeleted クエリを使用します。
GetDeleted FROM Leads
テーブルの最終更新以降に削除されたすべてのリードのリストを取得するには、UpdatedAt フィルタと共にGetDeleted クエリを使用します。
GetDeleted FROM Leads UpdatedAt='date'
Columns
| Name | Type | ReadOnly | Filterable | Description |
| Id [KEY] | Int | False | True |
This is a generated column, no description is available. |
| Company | String | False |
This is a generated column, no description is available. | |
| Site | String | False |
This is a generated column, no description is available. | |
| BillingStreet | String | False |
This is a generated column, no description is available. | |
| BillingCity | String | False |
This is a generated column, no description is available. | |
| BillingState | String | False |
This is a generated column, no description is available. | |
| BillingCountry | String | False |
This is a generated column, no description is available. | |
| BillingPostalCode | String | False |
This is a generated column, no description is available. | |
| Website | String | False |
This is a generated column, no description is available. | |
| MainPhone | String | False |
This is a generated column, no description is available. | |
| AnnualRevenue | Decimal | False |
This is a generated column, no description is available. | |
| NumberOfEmployees | Int | False |
This is a generated column, no description is available. | |
| Industry | String | False |
This is a generated column, no description is available. | |
| SicCode | String | False |
This is a generated column, no description is available. | |
| MktoCompanyNotes | String | False |
This is a generated column, no description is available. | |
| ExternalCompanyId | String | False |
This is a generated column, no description is available. | |
| MktoName | String | True |
This is a generated column, no description is available. | |
| PersonType | String | False |
This is a generated column, no description is available. | |
| MktoIsPartner | Bool | False |
This is a generated column, no description is available. | |
| IsLead | Bool | False |
This is a generated column, no description is available. | |
| MktoIsCustomer | Bool | False |
This is a generated column, no description is available. | |
| IsAnonymous | Bool | False |
This is a generated column, no description is available. | |
| Salutation | String | False |
This is a generated column, no description is available. | |
| FirstName | String | False |
This is a generated column, no description is available. | |
| MiddleName | String | False |
This is a generated column, no description is available. | |
| LastName | String | False |
This is a generated column, no description is available. | |
| String | False | True |
This is a generated column, no description is available. | |
| Phone | String | False |
This is a generated column, no description is available. | |
| MobilePhone | String | False |
This is a generated column, no description is available. | |
| Fax | String | False |
This is a generated column, no description is available. | |
| Title | String | False |
This is a generated column, no description is available. | |
| ContactCompany | Int | True |
This is a generated column, no description is available. | |
| DateOfBirth | Date | False |
This is a generated column, no description is available. | |
| Address | String | False |
This is a generated column, no description is available. | |
| City | String | False |
This is a generated column, no description is available. | |
| State | String | False |
This is a generated column, no description is available. | |
| Country | String | False |
This is a generated column, no description is available. | |
| PostalCode | String | False |
This is a generated column, no description is available. | |
| PersonTimeZone | String | True |
This is a generated column, no description is available. | |
| OriginalSourceType | String | True |
This is a generated column, no description is available. | |
| OriginalSourceInfo | String | True |
This is a generated column, no description is available. | |
| RegistrationSourceType | String | False |
This is a generated column, no description is available. | |
| RegistrationSourceInfo | String | False |
This is a generated column, no description is available. | |
| OriginalSearchEngine | String | True |
This is a generated column, no description is available. | |
| OriginalSearchPhrase | String | True |
This is a generated column, no description is available. | |
| OriginalReferrer | String | True |
This is a generated column, no description is available. | |
| EmailInvalid | Bool | False |
This is a generated column, no description is available. | |
| EmailInvalidCause | String | False |
This is a generated column, no description is available. | |
| Unsubscribed | Bool | False |
This is a generated column, no description is available. | |
| UnsubscribedReason | String | False |
This is a generated column, no description is available. | |
| DoNotCall | Bool | False |
This is a generated column, no description is available. | |
| MktoDoNotCallCause | String | False |
This is a generated column, no description is available. | |
| DoNotCallReason | String | False |
This is a generated column, no description is available. | |
| MarketingSuspended | Bool | False |
This is a generated column, no description is available. | |
| MarketingSuspendedCause | String | False |
This is a generated column, no description is available. | |
| BlackListed | Bool | False |
This is a generated column, no description is available. | |
| BlackListedCause | String | False |
This is a generated column, no description is available. | |
| MktoPersonNotes | String | False |
This is a generated column, no description is available. | |
| AnonymousIP | String | False |
This is a generated column, no description is available. | |
| InferredCompany | String | True |
This is a generated column, no description is available. | |
| InferredCountry | String | True |
This is a generated column, no description is available. | |
| InferredCity | String | True |
This is a generated column, no description is available. | |
| InferredStateRegion | String | True |
This is a generated column, no description is available. | |
| InferredPostalCode | String | True |
This is a generated column, no description is available. | |
| InferredMetropolitanArea | String | True |
This is a generated column, no description is available. | |
| InferredPhoneAreaCode | String | True |
This is a generated column, no description is available. | |
| EmailSuspended | Bool | False |
This is a generated column, no description is available. | |
| EmailSuspendedCause | String | False |
This is a generated column, no description is available. | |
| EmailSuspendedAt | Datetime | False |
This is a generated column, no description is available. | |
| Department | String | False |
This is a generated column, no description is available. | |
| CreatedAt | Datetime | True | True |
This is a generated column, no description is available. |
| UpdatedAt | Datetime | True | True |
This is a generated column, no description is available. |
| Cookies | String | False | True |
This is a generated column, no description is available. |
| ExternalSalesPersonId | String | False |
This is a generated column, no description is available. | |
| LeadPerson | Int | True |
This is a generated column, no description is available. | |
| LeadRole | String | False |
This is a generated column, no description is available. | |
| LeadSource | String | False |
This is a generated column, no description is available. | |
| LeadStatus | String | False |
This is a generated column, no description is available. | |
| LeadScore | Int | False |
This is a generated column, no description is available. | |
| Urgency | Double | False |
This is a generated column, no description is available. | |
| Priority | Int | False |
This is a generated column, no description is available. | |
| RelativeScore | Int | False |
This is a generated column, no description is available. | |
| RelativeUrgency | Int | False |
This is a generated column, no description is available. | |
| Rating | String | False |
This is a generated column, no description is available. | |
| PersonPrimaryLeadInterest | Int | True |
This is a generated column, no description is available. | |
| LeadPartitionId | Int | False |
This is a generated column, no description is available. | |
| LeadRevenueCycleModelId | Int | False |
This is a generated column, no description is available. | |
| LeadRevenueStageId | Int | False |
This is a generated column, no description is available. | |
| AcquisitionProgramId | Int | False |
This is a generated column, no description is available. | |
| MktoAcquisitionDate | Datetime | False |
This is a generated column, no description is available. | |
| TestKpQA | String | False |
This is a generated column, no description is available. | |
| TestCustomfieldEmail | String | False |
This is a generated column, no description is available. | |
| Ecids | String | True |
This is a generated column, no description is available. | |
| TestFieldText1 | String | False |
This is a generated column, no description is available. | |
| Test1 | Bool | False |
This is a generated column, no description is available. | |
| Cstmfdtest1 | String | False |
This is a generated column, no description is available. | |
| Cstmfdtest2 | String | False |
This is a generated column, no description is available. | |
| Test | String | False |
This is a generated column, no description is available. | |
| Test98 | String | False |
This is a generated column, no description is available. | |
| LookupField | String | False | True |
This is filter only column that will not contain data. |
| ListId | Int | False | True |
This is filter only column that will not contain data. |
| ProgramId | Int | False | True |
This is filter only column that will not contain data. |
| PartitionName | String | False | True |
This is filter only column that will not contain data. |
| MembershipAcquiredBy | String | True | False |
This is a generated column, that is only available when filtering by ProgramId. |
| MembershipIsExhausted | Bool | True | False |
This is a generated column, that is only available when filtering by ProgramId. |
| MembershipMembershipDate | Datetime | True | False |
This is a generated column, that is only available when filtering by ProgramId. |
| MembershipNurtureCadence | String | True | False |
This is a generated column, that is only available when filtering by ProgramId. |
| MembershipProgressionStatus | String | True | False |
This is a generated column, that is only available when filtering by ProgramId. |
| MembershipReachedSuccess | Bool | True | False |
This is a generated column, that is only available when filtering by ProgramId. |
| MembershipReachedSuccessDate | Datetime | True | False |
This is a generated column, that is only available when filtering by ProgramId. |
| MembershipStream | String | True | False |
This is a generated column, that is only available when filtering by ProgramId. |
| MembershipUpdatedAt | Datetime | True | False |
This is a generated column, that is only available when filtering by ProgramId. |