How can I send messages with attachments from circuit unify? - circuit-sdk

I need to send messages with attachments to the conference, also update messages for all users with an event.
Can somebody help me?
any example please

It would help if you specify what you have tried so far with a code example as this would also tell whether you are using the REST API or JS SDK (or Node.js SDK).
I'll assume you are using the JS SDK.
To send attachments use the addTextItem API. As seen on that page the attachments attribute is a regular File object.
An example app with file upload is available at https://github.com/circuit/circuit-sdk/blob/master/examples/js/messaging.html and running live at https://rawgit.com/circuit/circuit-sdk/master/examples/js/messaging.html.
This example is listed on our examples page at https://circuit.github.io/jssdk.html
Note that if you are referring to Node.js SDK file upload see example https://github.com/circuit/node-sdk-example
I am not clear what you mean "also update messages for all users with an event". The event raised when sending a message (with or without attachment) is itemAdded.
Subscribe to it via:
client.addEventListener('itemAdded', evt => {
console.log(evt);
});

Related

Coinbase Webhooks: is there a list of all data available?

I am looking into the webhook notifications and I am struggling to find documentation...
I would need to find the different payload for the "data" in the notification response...
the documentation only have one example: https://developers.coinbase.com/api/v2#show-a-notification
it is almost impossible to built an app if I need to try and see every type of notification by myself... (trial and error approach :( )
any extra resource? any help here?
thank you all
On this page, there is a link that says
See full list of notifications and corresponding payload information
But guess what, it links to the pages in your OP.
Even CB's newest documentation doesn't outline the payload until you run a sample to get the result displayed in the docs page. Here is a simple example, just click Try It to see the payload. It's not a bad thing until you need to see the payload of a signed request, then it's a PITA...
I've never used their webhooks to know how the payload differs but considering their docs you may need to run each notification to see what to expect and save the result to refer to later.

Hangouts/Chat - messagesUnread always 0 despite new messages

I'm trying to write a Hangouts/Chat dockapp to show unread message notifications, I'm using the following scope url:
https://www.googleapis.com/gmail/v1/users/me/labels/CHAT?access_token=<my_access_token>
The json returns fine, however messagesUnread is always 0. I've disconnected every possible app/browser etc that could be grabbing the messages before I reloaded the above URL, sent a new chat message from another account and messagesTotal increments by 1 but still the unread stays at 0. Even if I disable hangouts in the gmail web interface settings, send a message and search by "label:chat" the chat message that was received arrives marked as read in the web interface. If I manually mark a chat message as unread then the values in the above url do change correctly.
I can obviously work around this by storing he previous messagesTotal on comparing to current, however that creates a requirement to click the app to acknowledge the unreads which is a tad annoying.
Has anyone found a way to get a true unread count from chats/hangouts?
Thanks,
Haydn.
If you use the method users.labels.get for any other label (e.g. INBOX), it will return messagesUnread correctly.
Unfortunately for the label CHAT this is not the case
Chat messages are not quite the same as emails
It is not clear either it is intended behavior that you cannot retrieve the unread chat messages or a bug
This issue has been already filed on Google's Public Issue Tracker, but it has been closed by Google because it has been reported in Spanish.
Feel free to report the issue in English to hopefully obtain a response from Google eihter the bheavior is intended or a bug.

Mailjet: Exlude an email from being tracked when open-tracking is enabled

I am using Mailjet to send emails and have the 'open tracking' enabled ("Once activated, an invisible tracking pixel (image) is added to each email you send via Mailjet").
What I want to do is to deactivate the inclusion of this tracking pixel for certain emails. I know that it is possible with Mailjet for links to do that, but were not able to find a similar functionality for the tracking pixel.
Thank you!
Yes you can. (perhaps not at the time of the original question)
API send request accepts the Mj-trackopen field.
SMTP way accepts the header X-Mailjet-TrackOpen
API info - https://dev.mailjet.com/email/reference/send-emails/
SMTP info - https://dev.mailjet.com/smtp-relay/custom-headers/

Receiving notifications

I run a parse app that is basically an appointment system but I was wondering if there is a way that my app/parse can notify me when someone sets an appointment? As of right now I receive no emails or any kind of alert so I have to stay on the parse site, and refresh it every 5 minutes.
One thing you could do is write a cloud code pre save function that sends you an email automatically every time an appointment is saved.
https://parse.com/docs/cloud_code_guide#functions-onsave
That link should help you get started on writing a cloud code function on save for your objects.
As far as sending an email from Javascript, I believe it is doable, here is an example of part of a response that could help you:
http://stackoverflow.com/questions/7381150/how-to-send-an-email-from-javascript

Worklight api console request for Push

I need to get a list of users for a specific Push adapter/event source, and, I'm trying to use the API console requests, which says the format is:
http://{hostname}:{port}/{context-root}/console/api/{api-context}/{action}/{parameters}
and I'm using:
http://192.168.1.106:10080/Module_07_04_nativeAPIForiOSPush/console/api/Push/get/PushAdapter/PushEventSource
to search the demo project, which has one subscriber. However, I get 404 return from a browser request.
The first column of the docs is the "api-context", but, it lists "Push" and "Event Sources", which, obviously seems invalid.
What is the correct format to find users subscribed to a push for a specific adapter/event source?
WL server does not provide API for listing subscribed users. By design you should maintain your own DB of subscribed users, this is why you have onSubscribe onUnsubscribe callbacks in event source. As an alternative - you can look into WL's DB tables to find this info.