Twilio get international calls for current month - node.js

Is there a way to query only international calls from Twilio REST API? https://www.twilio.com/docs/api/rest/call#list-get-filters
Right now my best option seems to query all calls and then parse each one of them to get country code and then filter calls where countryTo != countryFrom. Any better way?

Twilio developer evangelist here.
No, you cannot filter by international calls via the API. Your method of filtering your list yourself is your best bet.

Related

Spring Integration querying multiple api's and aggregating the response

I'm a newbie to Spring Integration and am looking for a few pointers regarding how I could use it as follows:
Let's say I get a request from a client which for example is looking for a price comparison for some widget. On receipt of this request I would like to call out to multiple different company api's to get different prices and aggregate the each response (different response formats) before returning to the client.
I was just wondering which patterns I could use to do this
Looks like your requirements are fully covered with the Scatter-Gather pattern.
Spring Integration provides a particular implementation for you:
It is a compound endpoint, where the goal is to send a message to the recipients and aggregate the results. Quoting the EIP Book, it is a component for scenarios like best quote, when we need to request information from several suppliers and decide which one provides us with the best term for the requested item.

Twilio Real Time Recording

I am using Twilio voice call
and
want to get the voice data of other person(in voice call) at REAL TIME. So that i can convert it into text etc.
Please let me know how to achieve this.
I know twilio has a record call feature but
1) It gives url at the end of call not at real time
2) i think it will record the whole conversation (of both persons)
I am thinking of using node.js but not able to find solutions.
Twilio developer evangelist here.
I'm afraid our programmable voice feature doesn't support streaming the audio in real time in any way other than between the callers.
You can, however, use SIP with Twilio. You would need to provide your own PBX to make this work, but it then gives you access to the streaming audio, which you can then work with yourself.
Let me know if this helps at all?

How to grab instagram users based on a hashtag?

is there a way to grab instagram users based on a specific hashtag ?
I run contests based on re posting photos with specified hashtag then randomly pick a winner, i need a tool that can grab the usernames of those who reposted that photo and used that hashtag.
You can query instagram using the API. There are official clients for both python and ruby.
You didn't specify what language/platform you are using, so I'll give you the generic approach.
Query instagram using the Tag Recent Media endpoint.
In the response, you will receive a user object that has the user's username, id, profile url, and so on. This should be enough to do what you are describing.
As far as tools, there aren't great options to probably do things exactly how you want. If you just want a simple contest, you could use statigram, but it's not free.
If you roll your own solution, I highly recommend you also do the following:
Implement a rate limiting mechanism such as a task queue so you don't exceed your API calls (5000 per hour for most calls). Also useful for failures/network hicups, etc.
Have users authenticate so you can use OAuth to extend your API calls to 5000/per user/hour to get around #1.
Try the subscribe API if there won't be many items. You can subscribe to a specific tag as well, and you will get a change notification. At that point though you need to retrieve the actual media item(s), and this can cost a lot of API calls depending on how frequent and what volume these changes occur.
If your users don't have much photos/relatively small/known in advance, you can actually query the user's recent media instead and filter in your own code by hash tag.

How to supply name and email to Paymill payment

I am creating a Rails 3.2 application where I use Paymill to handle payments.
I can make one off payments using Active merchant. The problem with this is I cannot find a way to send the name of the buyer and the email address so the Paymill Client is incomplete. Also I would like to be able to create a Paymill subscription using Active merchant. Is this possible?
I know there is a Javascript version of the payment system and it works. Problem is I do not want to use Javascript, only ruby.
I have used this guide: How to make a payment via Paymill using Ruby
Thankful for all help!
Please, do NOT use Active Merchant if you don't have the proper PCI certifications. The Javascript version is the only way to use our service and profiting from our PCI compliance.
That being said, please take a look at the following paymill-ruby-wrapper, which has been provided by a third party developer - maybe it serves your purpose: https://github.com/dkd/paymill-ruby
Best regards,
Julian
(disclaimer: I work at PAYMILL)
Julian is right, you should not use ActiveMerchant except if you have the proper PCI certifications. It seems you want to do something like this:
1) Create a client object, passing the name (description) and email as parameters. See this: https://www.paymill.com/de-de/dokumentation/referenz/api-referenz/#create-new-client
2) Create a payment method object, passing the client as parameter (and the token retrieved by the JavaScript bridge): https://www.paymill.com/de-de/dokumentation/referenz/api-referenz/#create-new-credit-card-payment-with
3) Make a new transaction, passing the payment method object: https://www.paymill.com/de-de/dokumentation/referenz/api-referenz/#create-new-transaction-with
And to create a subscription, you need to have an offer object and a client with a valid payment method: https://www.paymill.com/de-de/dokumentation/referenz/api-referenz/#create-new-subscription

Getting events from Foursquare API

Can I get events from Foursquare API or just places?
You can get events via the API, documented at https://developer.foursquare.com/. In particular these two endpoints are probably what you're looking for:
https://developer.foursquare.com/docs/venues/events
https://developer.foursquare.com/docs/events/events
Note that there are limits on what sort of events you'll be able to retrieve as noted in the description for /venues/events

Resources