QuickBooks SDK CustomerQueryRq returns excess ShipToAddress elements - quickbooks

Since the version 12.0 of the qbXML the CustomerQueryRq responce retains the ShipToAddress elements - these are the random set of addresses ever used in QuickBooks. On Screen reference says the responce can contain up to 50 shipping addresses, but in reality it returns all the shipping addresses ever used in QuickBooks and because I have more than 10000 addresses - it retrieves each customer several seconds and crashes when I try to retrieve multiple customers.
I tried to use elements filtering - IncludeRetElement with only necessary fields, but the ShipToAddress elements start to appear the same time I include ShipAddress element(not ShipToAddress) into the retrieval list.
Is there way to retrieve customers from QuickBooks with the Shipping address without ShipToAddress, using qbXml 12.0/13.0?
P.S. For now I just use qbXml 11.0 but I want to use the latest versions in future.
My sample query I use:
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<CustomerQueryRq>
<FullName>Test Customer</FullName>
<IncludeRetElement>ShipAddress</IncludeRetElement>
</CustomerQueryRq>
</QBXMLMsgsRq>
</QBXML>

Related

XMPP: Performance Degradation List of Chats

We are facing performance degradation in iOS mobile app, which uses XMPPFramework
So literally after authentication we have 2 screens: (list of chats, and if chat from list is pressed - just real chat ).
After user authorised we starts chats’s sync process.
During sync process if I open any chat and trying to send some message or if I am at top of the chart and retrieve previous history page from archive then such requests are executed for a long time.
If syntonisation has finished the requests in such case execute in a short period of time.
But if there are some “scheduled” requests (IQs) for XMPP then on chat screen there is a big gap in receiving previous pages from MAM, or sending messages to the XMPP server.
Not sure what causes XMPP’s slow responsiveness: seems that XMPP executes sequentially requests from input stream.
How can we accelerate XMPP’s responsiveness in such case? Kind of request priority is needed :)
If number of chats is low (less than 10), then we don't see big delay, but if # is around 50 then we observe described above issue.
Should we use extra stream, when an user opens chat? Can it be easily done?
Stream authorisation can't be eliminated if I am not mistaken.
Technical details:
Stream has the following Info:
<stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" id="5454829587182882369" version="1.0" stream1:lang="en" from="xx.com"/>
RECV:
<stream:features xmlns:stream="http://etherx.jabber.org/streams">
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/>
<session xmlns="urn:ietf:params:xml:ns:xmpp-session">
<optional/>
</session>
<c xmlns="http://jabber.org/protocol/caps" ver="Sd=" node="http://www.process-one.net/en/ejabberd/" hash="sha-1"/>
<sm xmlns="urn:xmpp:sm:2"/>
<sm xmlns="urn:xmpp:sm:3"/>
<csi xmlns="urn:xmpp:csi:0"/>
</stream:features>
Session’s configuration: (2 duration minutes, keepAlive - 120 seconds)
<iq type="set" id="302D4903-9EA7-4AF1-A070-0362B18D69BE">
<push xmlns="p1:push" apns-sandbox="true">
<appid>xxt</appid>
<keepalive max="120"/>
<session duration="2"/>
<body send="all" groupchat="true" from="none"/>
<status type="xa">Text Message when in push mode</status>
<offline>true</offline>
<notification>
<type>applepush</type>
<id>fafa</id>
</notification>
</push>
</iq>
Sync process:
From our backend we get list of conversations, & contacts.
For each chat if it’s MUC we subscribe to it (muc PubSub).
<iq type="set" to="439f1818257dc7eda13a#muc.staging.chat.fitgrid.com" id="BFA024EB-0291-4207-84CC-BD3469568FFE">
<subscribe xmlns="urn:xmpp:mucsub:0" nick="1686a817de5fc4240270#sxx.com">
<event node="urn:xmpp:mucsub:nodes:messages"/>
</subscribe>
</iq>
To get the latest message for each chat we retrieve the latest message from MAM (archive):
<iq type="set" id="6EEB490A-D421-4007-9DA8-E9D2E54DC268" to="ca65cc04b8b8995961f3#muc.xx.com">
<query xmlns="urn:xmpp:mam:2" queryid="15E9F8CC-1FBE-4DCD-982C-8440E0597BFF">
<x xmlns="jabber:x:data" type="submit">
<field var="FORM_TYPE" type="hidden">
<value>urn:xmpp:mam:2</value>
</field>
</x>
<set xmlns="http://jabber.org/protocol/rsm">
<max>1</max>
<before/>
</set>
</query>
</iq>
After messages are received we store them to our local DBs.
We are tracking status of message (sent, read and so on), by using chart markers.
Also there is a small number of Group Rosters’ subscription - it shouldn’t be critical point…
Apparently, we use different threads for processing, we don’t block UI (main) thread.
Any ideas?
P.S. attempt to establish extra stream on selected chat led to the following error (RECV):
<stream:error xmlns:stream="http://etherx.jabber.org/streams">
<conflict xmlns="urn:ietf:params:xml:ns:xmpp-streams" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-streams" lang="en">Replaced by new connection</text>
</stream:error>
But this because of server configuration (in-order processing) https://xmpp.org/rfcs/rfc6120.html#rules-order
Default port is 5222 for TCP connection, seems that extra port should be enabled.

Real time transcription | Twilio Agent Conference

I am referrring to the demo Kris gives here, especially the separate active transcriptions that show up for Stuart and Kris. I am familiar with conference, gather, dial but I am not able to replicate the entire architecture. I am interested in placing 2 people on a conference and somehow receive their transcriptions in real-time as the wonderful demo shows. I have enabled Agent-Conference tried the coach feature, but still can't figure out how to use Gather with conference participants. If I put a participant in Gather mode the other participant can't hear her. Can anyone please throw some pointers, I am sure I'm missing something basic here.
Till now I have tried:
Call call1 = Call.creator(new PhoneNumber("MyNumber"), new PhoneNumber("VerifiedTwilioNumber"),
new URI("https://mywebsite/gather.xml")).create();
https://mywebsite/gather.xml returns
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather input="speech" speechTimeout="auto" partialResultCallback="https://mywebsite/gather_twilio_webhook_servlet">
</Gather>
</Response>
Using this I speak to no-one but whatever I speak gets shown real-time on my gather_twilio_webhook_servlet.
I have also made conferences using :
Call call1 = Call.creator(new PhoneNumber("MyNumber"), new PhoneNumber("VerifiedTwilioNumber"),
new URI("https://mywebsite/conf.xml")).create();
Call call2 = Call.creator(new PhoneNumber("MyFriendsNumber"), new PhoneNumber("VerifiedTwilioNumber"),
new URI("https://mywebsite/conf.xml")).create();
https://mywebsite/conf.xml returns:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Conference startConferenceOnEnter="true" endConferenceOnExit="true">Room 123</Conference>
</Dial>
</Response>
I am trying combinations thereof but not able to find a documentation to replicate Kris's exact use case. Any help will be much appreciated. Thanks!
Update, more trials:
If I try something like:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather input="speech" speechTimeout="auto" partialResultCallback="https://mywebsite/gather_twilio_webhook_servlet" language="en-IN">
<Dial>
<Conference record="record-from-start">room-2</Conference>
</Dial>
</Gather>
</Response>
I get ErrorCode "13320" Msg "Gather: Invalid nested verb"
Twilio developer evangelist here.
The demo Kris showed is not available right now to use publicly. I know it was a while back, but bringing it to market was not as high a priority as other things we have launched since.
If you are interested in features like this, I recommend you get in touch with sales and discuss what you would like to use it for.
This is probably late now. But, you can check out these apps if it helps -
Video Conferencing built using Twilio Video SDK with live captions - https://github.com/symblai/symbl-twilio-video-react
Twilio Media Streams Integration - https://github.com/symblai/symbl-twilio-media-streams-integration

Twilio: Get parameters from outbound calls from recordings

I have a TwiMl like this in a Bin:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="alice">Hello {{Name}}. You have ticket number {{TicketNum}} so please solve it.</Say>
</Response>
Then I use hmac authentication and launch the script to make the call using the following TWIML Bin url with query strings attached:
twiml_link="https://handler.twilio.com/twiml/EHxxxxxxxxxxx?Name=Bob&TicketNum=45"
I get the call with Bob and Ticket 45. After that I need to alert our incident tracking system that Bob has acknowledge the ticket 45 and is "on it." I can't because of architecture send something back to my system. I need to go out and query twilio again.
So I wrote this python snippet to hit the Twilio API to find all completed calls. :
from twilio.rest import Client
import sys, os
# Your Account Sid and Auth Token from twilio.com/console
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)
calls = client.calls.list(status=completed)
for call in calls:
print(call.sid)
print(call.to)
print(call.status)
print(call.start_time)
print(call.duration)
print(call.annotation)
print(call.uri)
None of these commands can print Bob or the ticket number or the Twiml Bin URL or the query strings I used. Any tips? Thanks in Advance!
That approach isn't a reliable way to determine if the intended party answered the phone and acknowledge the message without "Human Detection". You can find more details here.
Alternative to AMD - "Human Detection"
https://support.twilio.com/hc/en-us/articles/223132567-Can-Twilio-tell-whether-a-call-was-answered-by-a-human-or-machine-#alternatives-to-amd
The dialed party could be a voicemail system, so querying the REST API to see if the call status was completed will provide misleading results if your goal is to determine the person acknowledged the ticket.
You could use a Twilio Function, https://support.twilio.com/hc/en-us/articles/115007737928-Building-apps-with-Twilio-Functions, to collect the result of the
Alan

Recurly Webhook ID

I am trying to prevent Recurly Webhooks from being executed multiple times if they are retried incorrectly (i.e.: when builds go out and servers time out occasionally). I see in the dashboard that webhooks have unique IDs, but these don't seem to be accessible in the message hash, am I missing something? I'm using Rails for what it's worth.
<?xml version="1.0" encoding="UTF-8"?>
<updated_subscription_notification>
<account>
<account_code>1</account_code>
<username nil="true"></username>
<email>verena#example.com</email>
<first_name>Verena</first_name>
<last_name>Example</last_name>
<company_name nil="true"></company_name>
</account>
<subscription>
<plan>
<plan_code>1dpt</plan_code>
<name>Subscription One</name>
</plan>
<uuid>292332928954ca62fa48048be5ac98ec</uuid>
<state>active</state>
<quantity type="integer">1</quantity>
<total_amount_in_cents type="integer">200</total_amount_in_cents>
<activated_at type="datetime">2010-09-23T22:12:39Z</activated_at>
<canceled_at nil="true" type="datetime"></canceled_at>
<expires_at nil="true" type="datetime"></expires_at>
<current_period_started_at type="datetime">2010-09-23T22:03:30Z</current_period_started_at>
<current_period_ends_at type="datetime">2010-09-24T22:03:30Z</current_period_ends_at>
<trial_started_at nil="true" type="datetime">
</trial_started_at>
<trial_ends_at nil="true" type="datetime">
</trial_ends_at>
<collection_method>automatic</collection_method>
</subscription>
</updated_subscription_notification>
Unfortunately the only way to stop webhooks from being resent is to reply with a 200 status code with 5 seconds.(https://docs.recurly.com/docs/webhooks)
It was 30 seconds but that got changed November 2015 I think.
Anyway I solved it by throwing the message off to a queue and immediately responding with 200 response.
A webhook may be retired several times, however once a successful status code is received by your server, Recurly will stop attempting to resend that notification. Hence, only one webhook will be delivered per event. Also, webhook IDs aren't included in the message hash, they're only found in the UI.

How reliable is yahoo finance?

How reliable is yahoo finance ?
For example the below request :
http://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22YHOO%22%2C%22AAPL%22%2C%22GOOG%22%2C%22MSFT%22%29
intermittently returns the response : "The current table 'yahoo.finance.quotes' has been blocked. It exceeded the allotted quotas of either time or instructions"
Here is the complete response :
<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
yahoo:count="0" yahoo:created="2013-04-08T11:16:18Z" yahoo:lang="en-US">
<diagnostics>
<publiclyCallable>true</publiclyCallable>
<url execution-start-time="24" execution-stop-time="25"
execution-time="1" proxy="DEFAULT"><![CDATA[http://www.datatables.org/yahoo/finance/yahoo.finance.quotes.xml]]></url>
<cache execution-start-time="27" execution-stop-time="27"
execution-time="0" method="GET" type="MEMCACHED"><![CDATA[13c4f8eac77ad886bade5a711c8c1ef5]]></cache>
<javascript name="yahoo.finance.quotes" verb="select"><![CDATA[The current table 'yahoo.finance.quotes' has been blocked. It exceeded the allotted quotas of either time or instructions]]></javascript>
<user-time>28</user-time>
<service-time>1</service-time>
<build-version>35405</build-version>
</diagnostics>
<results/>
</query>
To get a reliable service do I need to sign up and pay ?
To get a reliable service do I need to sign up and pay ?
Here are the limits:
Public OAuth with API Key
Hourly Cap 2,000 20,000
Daily Cap None 100,000
To better understand the rate limits in the above table, let's use the following example. Suppose you create an application that generates around 3,000 requests from each user per hour. You notice though that users are capped at a maximum of 2,000 calls using the public endpoint, so you register an API Key with Yahoo! to use the authenticated/authorized endpoint. Now your users can make 20,000 requests per hour and up to a total of 100,000 requests per day.
oAuth is free.
References
YQL Overview - Yahoo Developer Network
Public API Down Detector

Resources