view 属性控制每条结果的 data 对象中出现哪些存储字段。
view 可以取哪些值
默认值是
id_only。当应用需要记录详情时请显式设置 view,否则只会收到标识符而非描述性字段。
summary 视图包含什么
公司summary 返回 14 个字段:name、slogan、industry、headquarters_location、headquarters_country_code、offices_cities、company_size_from、company_size_to、employees_in_linkedin、linkedin_followers、website、domain、url 和 logo。
人物 summary 返回 11 个字段:name、current_title、current_company_name、current_company_industry、location、city、country_code、followers、connections、url 和 avatar。
记录中没有值的字段会从 data 中省略,而不是返回 null,因此同一请求返回的两条记录可能带有不同的键。
full 视图包含什么
full 返回所有已发布字段。公司 full 在 14 个 summary 字段之外,还包括 about、specialties、organization_type、founded_year、headquarters_city、offices_country_codes、alumni_count、linkedin_follower_to_employee_ratio、funding_stage、funding_raised、investor_names、similar_company_ids、affiliated_company_ids、crunchbase_id、image 和 linkedin_id。
人物 full 在 11 个 summary 字段之外,还包括 first_name、about、recommendations_count、influencer、patent_count、current_tenure_months、experience_years、past_job_titles、past_company_names、past_company_ids、education_schools、education_details、certification_names、languages、current_company_id、current_company_specialties、current_company_country_code、current_company_size_from、current_company_size_to、current_company_funding_stage、current_company_funding_raised、similar_profile_ids、also_viewed_ids、linkedin_num_id 和 linkedin_person_id。
fields 列表可以指定其中任意字段。记录中没有值的字段会被省略,因此一条 full 记录携带的键通常少于上述列表。
如何请求自定义字段列表
当应用需要特定字段集合时,请使用自定义字段列表,例如summary 视图未包含的公司字段 founded_year:
代码应如何处理返回的 data 对象
以下四条规则可以让解析逻辑在各种记录下保持稳定:- 只有当数据源对该记录存有值时,所请求的字段才会出现。
- 处理空值或 null 时不要让整条记录失败。
- 未知或未发布的字段名会返回 HTTP 400
view: unknown field(s): not_a_released_field,未知的视图名会返回view: unknown view profile "bogus_view"。新字段名只需验证一次,不必每次请求都验证。 - 把
bright_id这个信封字段与data中的实体字段区分开。bright_id用于标识记录,不是公司或人物的属性。