Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Back to post

Revisions 2

3 years ago
Yong Sheng Tan
39 × 2 Administrator
External Contacts for Bots
External Contacts for Bots
Your bot will either need to send connection requests to external contacts, accept their incoming connection requests, or both, depending on what your workflow is. You can use the connections client's create or accept calls. If you want to accept connection requests as they arrive in real-time, you can create a connections listener and call accept with the incoming user id, but you will want to build some sort of governance to ensure that you are not accepting anyone who asks. You can validate against the incoming request's email, for example, and maybe restrict it to a domain name. ```python # Python BDK Example class MyConnectionsListener(RealTimeEventListener): def __init__(self, connections: ConnectionService): self._connections = connections async def on_connection_requested(self, initiator: V4Initiator, event: V4ConnectionRequested): email = initiator.user.email if (email.endswith("@my-trusted-bank.com")): self._connections.accept_connection(initiator.user.user_id) logging.info(f"Accepted connection request from {email}") else: logging.info(f"Rejected connection request from {email}") ```
Your bot will either need to send connection requests to external contacts, accept their incoming connection requests, or both, depending on what your workflow is. ```python # Python BDK Example class MyConnectionsListener(RealTimeEventListener): def __init__(self, connections: ConnectionService): self._connections = connections async def on_connection_requested(self, initiator: V4Initiator, event: V4ConnectionRequested): email = initiator.user.email if (email.endswith("@my-trusted-bank.com")): self._connections.accept_connection(initiator.user.user_id) logging.info(f"Accepted connection request from {email}") else: logging.info(f"Rejected connection request from {email}") ``` You can use the connections client's create or accept calls. If you want to accept connection requests as they arrive in real-time, you can create a connections listener and call accept with the incoming user id, but you will want to build some sort of governance to ensure that you are not accepting anyone who asks. You can validate against the incoming request's email, for example, and maybe restrict it to a domain name.
3 years ago
Original
Yong Sheng Tan
39 × 2 Administrator
External Contacts for Bots

Your bot will either need to send connection requests to external contacts, accept their incoming connection requests, or both, depending on what your workflow is. ```python # Python BDK Example class MyConnectionsListener(RealTimeEventListener): def __init__(self, connections: ConnectionService): self._connections = connections async def on_connection_requested(self, initiator: V4Initiator, event: V4ConnectionRequested): email = initiator.user.email if (email.endswith("@my-trusted-bank.com")): self._connections.accept_connection(initiator.user.user_id) logging.info(f"Accepted connection request from {email}") else: logging.info(f"Rejected connection request from {email}") ``` You can use the connections client's create or accept calls. If you want to accept connection requests as they arrive in real-time, you can create a connections listener and call accept with the incoming user id, but you will want to build some sort of governance to ensure that you are not accepting anyone who asks. You can validate against the incoming request's email, for example, and maybe restrict it to a domain name.