Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api3 - Add uf_user contact search param #13230

Merged
merged 1 commit into from
Dec 5, 2018

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Dec 5, 2018

Overview

Exposes another advanced search field to the api.

Before

Not available to search contacts with/without user records.

After

Available to search contacts with/without user records.

@civibot
Copy link

civibot bot commented Dec 5, 2018

(Standard links)

@civibot civibot bot added the master label Dec 5, 2018
@eileenmcnaughton eileenmcnaughton merged commit d434a5c into civicrm:master Dec 5, 2018
@eileenmcnaughton eileenmcnaughton deleted the Api3 branch December 5, 2018 21:56
@totten
Copy link
Member

totten commented Dec 6, 2018

@colemanw FWIW, there is a way to search by username -- any API filter that accepts a contact ID can take @user:<name> instead:

# Find contact for user "demo"
cv api contact.get id=@user:demo

# Find activities created by user "demo"
cv api activity.get source_contact_id=@user:demo

# Create a note about user "demo" attributed to user "admin"
cv api note.create contact_id=@user:admin entity_table=civicrm_contact entity_id=@user:demo note='the best demo user ever' 

It's pretty flexible/general/simple, but I don't know an effective way to communicate its existence...

I like how this param is more discoverable, but it'd be a lot of work to reproduce for other use-cases.

@eileenmcnaughton
Copy link
Contributor

@totten I am not even sure that syntax is in the api docs...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants