subscribe to all paypal webhooks events - paypal-webhooks

How can we subscribe to all events at a single time in paypal webhooks ?
{
"url": "https://www.yeowza.com/paypal_webhook",
"event_types": [
{
"name": "PAYMENT.AUTHORIZATION.CREATED"
},
{
"name": "PAYMENT.AUTHORIZATION.VOIDED"
}
]
}
This tells about subscribing to specific webhooks but not all webhooks.

You can use the following payload to subscribe to all webhooks :
"event_types": [
{
"name": “*"
}
]
Please refer PayPal Webhooks documentation # https://developer.paypal.com/docs/api/#create-a-webhook
Note: To subscribe to all event types, use an * (asterisk) as a
wildcard for an event name in the event_types field. When you specify
the * wildcard for an event name in the event_types field, your
webhook is automatically subscribed to all event types, including any
new event types as support for them is added. This is also true when
you update an existing webhook by replacing a previously specified
array of event types with the * wildcard as the only event name. To
see all currently supported event types, you can issue a request to
Get a reference list of webhook event types.

Related

Slack API - How to get bot_id when bot has no conversation history?

I am trying to get the bot_id value for a bot when it has no conversation history.
According to the documentation:
the bot_id fields appear in bot_message message event subtypes and in
the response of methods like conversations.history.
This makes sense and works.
But is it possible to get this bot_id value, when a bot has no conversation history?
For example, say the channel between Slackbot and my bot has no conversation history. The response of a conversations.history request to this channel is the following, which does not include the bot_id value.
{
"ok": true,
"channel": {
"id": "DC6N8Q1BK",
"created": 1534129098,
"is_im": true,
"is_org_shared": false,
"user": "USLACKBOT",
"last_read": "0000000000.000000",
"latest": null,
"unread_count": 0,
"unread_count_display": 0,
"is_open": true,
"priority": 0
}
}
Any other way to get the bot_id value?
If there is a bot user, you can get it from the normal userlist with users.list. But that will not include other apps.
Then there is the unofficial API method bots.list. That will give you a list of all bots, but its not officially supported and you will need a legacy token to use as with many undocumented methods.

Trigger lambda on ECR PutImage event

I'm having trouble understanding why a Cloudwatch event rule is not firing.
I've followed this related question and did the following.
Created a Cloudtrail which sends events to a Cloudwatch log
Created the following CloudWatch event rule:
{
"detail-type": [
"AWS write API Call via CloudTrail"
],
"source": [
"aws.ecr"
],
"detail": {
"eventSource": [
"ecr.amazonaws.com"
],
"eventName": [
"PutImage"
]
}
}
Created a lambda to be invoked by this rule.
I can verify that in my Cloudwatch log group (set up to accept events from Cloudtrail) I am seeing the PutImage event. However, the lambda never fires and the rule metrics show that it is never triggered. I am assuming at this point the rule must be faulty (I would expect to see the rule triggered even if the lambda is faulty) but I can't see what additional logic is required. Is it necessary to link my event to a particular log group?

Is botId that bot scoped? Is it permanent?

Is the botId that I receive in the webhook only bot scope or is it unique across all the bots found?
Is it permanent or can it be changed?
By botId I mean the id in recipient.id and replyToId that you fill in send message request to endpoint https://smba.trafficmanager.net/apis/v3/conversations/{{skype.idRecipient}}/activities:
{
"text": "God help us!",
"type": "message",
"from": {
"id": "{{skype.idBot}}",
"name": "bot"
},
"recipient": {
"id": "{{skype.idRecipient}}",
"name": "user"
},
"replyToId": "{{skype.idBot}}"
}
The ID you are talking about is unique only in the current channel (Skype/Facebook/Slack...) as it is the ID of ChannelAccount.
Here are some statements from documentation:
Every bot and user has an account within each channel. The account
contains an identifier (id) and other informative bot non-structural
data, like an optional name.
Also
Channel accounts have meaning only within their associated channel
So it's not excluded that id may be repeated on another channels.
And what about permanency, it depends on the channel you use as stated in documentation again:
The stability of associations between IDs, accounts, mailboxes, and
people depends on the channel
But if you want it to be "unique across all the bots found" then you can create an id by combining AppID, ChannelID and User ID.
Also here is a quite informative guide about IDs in Bot Framework which may be helpful to you

No outlook webhook notification for events in secondary calendars

I have successfully subscribed to changes of the events resource with a request body of:
{
"#odata.type": "#Microsoft.OutlookServices.PushSubscription",
"Resource": "me/events",
"NotificationURL": "...",
"ChangeType": "Created, Updated, Deleted"
}
Although I get the expected webhook notification when modifying an event in the user's default calendar, I don't get any webhook notifications when modifying events in other calendars of the same user.
Am I doing something wrong or is it a bug or just an undocumented behaviour?
To subscribe the notification of other calendars, you need to change the the "Resource" to "me/calendars/{calendar_id}/events".
GET https://outlook.office.com/api/v2.0/me/calendars
{
"#odata.type": "#Microsoft.OutlookServices.PushSubscription",
"Resource": "me/calendars/{calendar_id}/events",
"NotificationURL": "...",
"ChangeType": "Created, Updated, Deleted"
}

parse.com API: Is it possible to send multiple push notifications in one network call?

I am looking at the Parse Push API documentation and have tried it successfully, but is it possible to send multiple push notifications in one network call, for example by sending a JSON array of notifications.
Single notification JSON object as in the official documentation:
{
"where": {
"injuryReports": true
},
"data": {
"alert": "Willie Hayes injured by own pop fly."
}
}
I would like to send multiple notifications using an array instead:
[{
"where": {
"injuryReports": true
},
"data": {
"alert": "Willie Hayes injured by own pop fly 1."
}
},
{
"where": {
"injuryReports": false
},
"data": {
"alert": "Willie Hayes was not injured by own pop fly 2."
}
}
]
An array of notifications does not seem to be supported at this time. I am getting an invalid JSON format error in the response. I was wondering if this is supported, but I am using the wrong JSON structure.
If it is not supported, I would request the parse team to support it as it will be very convenient for processing multiple notifications with one API call instead of making a separate network call for each push.
I think you can push a JsonArray from parse notifications via bundle.
If your Activity is launched via a push, then the bundle.getIntent().getExtras() will have the JSON in the extra string com.parse.Data.
For more details, please refer to here and here.

Resources