getAll() returns 0(zero) items
Hello,
I have created some test accounts under admin account(Rainbow Sanbox developer account).
When I used the function rainbowSDK.contacts.getAll(), it returns zero array items in node js.
Do I need to modified any parameters?

Regards,
Sunny
-
Hi Sunny,
Creating contacts does not mean that they belong to the contact's list of a user.
The list of contacts of a user is something personal. Each list can be different for each user and need to be provisionned.
To add contacts to the list of contacts (aka to add contact to the network), you can either:
1/ From the user himselft, ask an other if he wants to be part of your list of contacts. This can't be done with the Node SDK at this time to avoid large contacts list. This can be done using the SDK for Web, IOS and Android.
2/ By using an admin account and adding directly one user to the network of an other user: https://hub.openrainbow.com/#/documentation/doc/sdk/node/api/contacts#Contacts+joinContacts
Adding a contact to the list of contacts allows access to his availability (phone, presence...). That's why you need the authorization from the recipient.If you don't need that, you can:
- Search for the contact using one of the methods described here: https://hub.openrainbow.com/#/documentation/doc/sdk/node/api/contacts
- Store him to a group you have created: https://hub.openrainbow.com/#/documentation/doc/sdk/node/api/groups
- And them contact him by retrieving him from this group when you need...
It depends on your use case.
More information can be found here: https://hub.openrainbow.com/#/documentation/doc/sdk/node/guides/Managing_contacts
Hope this will help,
Regards,
Olivier
-
Hello Olivier ANGUENOT,
Thank you for your reply.
Please elaborate on how to add a contact to a network. I would be happy if you share me some piece of code on the below point using SDK for Web.
"1/ From the user himselft, ask an other if he wants to be part of your list of contacts. This can't be done with the Node SDK at this time to avoid large contacts list. This can be done using the SDK for Web, IOS and Android."
Suppose I have bellow accounts in developer sandbox account:
LoginEmail Roles
************** *****************
1/ exampleadmin@company.com ->user,admin,app_admin
2/ exampleOne@company.com ->user
3/ exampleTwo@company.com ->user
if user "exampleOne@company.com" wants to add the user "exampleTwo@company.com" in his network, how could I proceed it through coding or through others.
Regards,
Sunny
-
Hi Sunny,
After checking, you're right. A documentation explaining these points are missing in our documentation. I will try to cover them in a new guide soon.
In the meantime, you can use the following API:
1/ You can use methods such as https://hub.openrainbow.com/#/documentation/doc/sdk/web/api/contacts#module_Contacts.searchByName to find others contacts
2/ To send an invitation joining the user network, use the method: https://hub.openrainbow.com/#/documentation/doc/sdk/web/api/contacts#module_Contacts.addToContactsList
3/ You (in recipient code) need to listen to event: https://hub.openrainbow.com/#/documentation/doc/sdk/web/api/contacts#event_RAINBOW_ONCONTACTINVITATIONRECEIVED to be notified of the request of the issuer
4/ Once received, you can accept or decline using these methods: https://hub.openrainbow.com/#/documentation/doc/sdk/web/api/contacts#module_Contacts.acceptInvitation or https://hub.openrainbow.com/#/documentation/doc/sdk/web/api/contacts#module_Contacts.declineInvitation
Other methods exist to remove a contact from your contacts list, etc...
Just for your information, if the recipient belongs to the same company than the issuer, the invitation will be automatically accepted. No need to do it on recipient side.If users are in separate companies, step 4/ has to be done.
Once part of your network, you will be able to access to recipient's availability (phone presence, user presence, etc...)
hope this will help,
Regards,
Olivier
Iniciar sesión para dejar un comentario.
Comentarios
4 comentarios