Search Filters
(Difference between revisions)
Renato.neves (Talk | contribs) (→Operators) |
Renato.neves (Talk | contribs) (→Relational Operators) |
||
Line 10: | Line 10: | ||
| select * from profile where profile.gender = 'male' or profile.religion = 'Atheist' | | select * from profile where profile.gender = 'male' or profile.religion = 'Atheist' | ||
| profile.gender = 'male' or profile.religion = 'Atheist' | | profile.gender = 'male' or profile.religion = 'Atheist' | ||
+ | |} | ||
+ | |||
+ | == Logical Operators == | ||
+ | |||
+ | {| | ||
+ | ! align="left" width="200px" | Código | ||
+ | ! align="left" width="200px" | Operação | ||
+ | ! align="left" | Exemplo | ||
+ | |+ | ||
+ | ! align="left" width="200px" | and | ||
+ | | width="200px" | Conjunção | ||
+ | | profile.name.formatted = 'Guilherme Silva' and profile.gender = 'male' | ||
+ | |+ | ||
+ | ! align="left" width="200px" | or | ||
+ | | width="200px" | Disjunção | ||
+ | | profile.name.formatted = 'Guilherme Silva' or profile.gender = 'male' | ||
+ | |+ | ||
+ | ! align="left" width="200px" | not | ||
+ | | width="200px" | Negação | ||
+ | | not profile.gender = 'male' | ||
|} | |} | ||
Revision as of 23:02, 15 August 2013
O padrão utilizado na busca de contatos é "SQL-like", ou seja, a sintaxe é muito parecida com o que usamos para consultas em bancos de dados relacionais. Alguns exemplos de queries:
SQL | People Search API | select * from profile where profile.gender = 'male' | profile.gender = 'male' | select * from profile where profile.gender = 'male' or profile.religion = 'Atheist' | profile.gender = 'male' or profile.religion = 'Atheist' |
---|
Contents |
Logical Operators
Código | Operação | Exemplo | and | Conjunção | profile.name.formatted = 'Guilherme Silva' and profile.gender = 'male' | or | Disjunção | profile.name.formatted = 'Guilherme Silva' or profile.gender = 'male' | not | Negação | not profile.gender = 'male' |
---|
Relational Operators
Código | Operação | Exemplo | = | Igualdade | profile.name.formatted = 'Guilherme Silva' | != | Diferença | profile.name.formatted = 'Guilherme Silva' | < | Menor que | profile.id < 100 | > | Maior que | profile.id > 100 | <= | Menor ou igual | profile.id <= 100 | >= | Maior ou igual | profile.id >= 100 | like | Operador "like" | profile.name.given_name like 'Guilher%' | between | Entre :A e :B | profile.id between 1 and 3 | in | Operador "in" | profile.id IN (100, 99, 104) | is null | Atributo é nulo | profile.religion is null | is not null | Atributo não é nulo | profile.religion is not null |
---|
Namespaces
Os campos a serem buscados podem ser especificados no padrão "namespace.fieldname".
Temos disponíveis os seguintes namespaces e campos:
person
Campo | Explicação | person.id | Número de identificação | person.email | person.created | Data de criação | person.updated | Data de última atualização |
---|
profile
Campo | Explicação | profile.display_name | Nome de Exibição | profile.name.formatted | Nome completo | profile.name.family_name | Sobrenome | profile.name.middle_name | Nome do Meio | profile.name.given_name | Primeiro Nome | profile.name.honorific_prefix | Honorífico (prefixo) | profile.name.honorific_suffix | Honorífico (sufixo) | profile.nickname | Apelido | profile.updated | Data da Última Atualização | profile.birthday | Aniversário | profile.gender | Sexo | profile.preferred_username | Nome de Usuário Escolhido | profile.utf_offset | Fuso Horário UTC | profile.about_me | Sobre Mim | profile.current_location | Localização Atual | profile.religion | Religião | profile.status | Último status do Twitter do contato, se disponível | profile.emails.value | profile.emails.type | profile.emails.primary | profile.urls.value | profile.urls.type | profile.urls.primary | profile.phone_numbers.value | profile.phone_numbers.type | profile.ims.value | profile.ims.type | profile.languages_spoken.name | profile.languages_spoken.level | profile.addresses.formatted | profile.addresses.street_address | profile.addresses.locality | profile.addresses.region | profile.addresses.postal_code | profile.addresses.country | profile.organizations.name | profile.organizations.department | profile.organizations.title | profile.organizations.type | profile.organizations.start_date | profile.organizations.end_date | profile.organizations.location | profile.organizations.description | profile.organizations.primary | profile.educations.name | profile.educations.type | profile.educations.start_date | profile.educations.end_date | profile.educations.description | profile.educations.degree | profile.interests.name | profile.interests.category | profile.interests.link | profile.likes.name | profile.likes.category | profile.likes.link | profile.political_views | profile.picture_url | profile.profile_url | profile.locale | profile.verified_account | profile.verified_email | profile.hometown | profile.interested_in_meeting | profile.quotes | profile.significant_other | profile.industry | profile.professional_headline | profile.specialties | profile.honors |
---|
custom
Os campos custom dependem dos campos customizados criados nos webforms. Cada Conta de Marketing tem seu próprio conjunto de campos custom.
Para filtrar pelos campos custom basta criar regras com "custom.nome_do_campo".