google analytics api v4 unpredictable - google-analytics-api

i am using google analytics api v4 to get some data of an account. it works fine but mostly but unpredictably i just get this in response, with no data but just row count.
{u'reports': [{u'data': {u'rowCount': 230, u'isDataGolden': True}, u'columnHeader': {u'dimensions': [u'ga:channelGrouping', u'ga:date'], u'metricHeader': {u'metricHeaderEntries': [{u'type': u'INTEGER', u'name': u'ga:users'}, {u'type': u'INTEGER', u'name': u'ga:transactions'}, {u'type': u'CURRENCY', u'name': u'ga:revenuePerTransaction'}, {u'type': u'CURRENCY', u'name': u'ga:transactionRevenue'}, {u'type': u'INTEGER', u'name': u'ga:itemQuantity'}, {u'type': u'CURRENCY', u'name': u'ga:itemRevenue'}]}}}]}
it shows that there are some rows but the rows itself are not returned in respons. why is it so?

Related

Print raw Dialogflow query result fulfillment message

I have the following DialogFlow default and Facebook responses for an intent.
I have a simple Flutter app that calls detectIntent on a DialogflowAPI object that returns a response with query result. I want to print the raw fulfilment messages to console.
...
var response = await df.detectIntent(request, sessionPath);
List<GoogleCloudDialogflowV2IntentMessage> payloads = response.queryResult.fulfillmentMessages;
debugPrint("Got response length: ${payloads.length}");
payloads.forEach((element) => debugPrint(element.payload.toString()));
I get the below console output:
flutter: Got response length: 3
flutter: {text: this is some default text!, replies: [default option 1, default option 2]}
flutter: null
flutter: {replies: [default option 1, default option 2], text: this is some default text!}
There are 3 responses, of which 2 are printed correctly. It does not print the quick replies part of the facebook response.
Each GoogleCloudDialogflowV2IntentMessage has a payload member, which is a json-like Map<String, Object?>. You can print this out:
payloads.forEach((element) => debugPrint(element.payload.toString()));
Alternatively
There is also a toJson() method, which might give you more complete information. You can try printing that as well:
payloads.forEach((element) => debugPrint(jsonEncode(element.toJson())));
Note: you'll need to include import 'dart:convert';.

How to get latest bot response in rasa Chatbot?

How to get latest bot response with Rasa Chatbot?
For getting user input we use : tracker.latest_message['text']
So, what is syntax for getting latest bot response ?
Thanks
You can use the tracker.events list to fetch the latest bot event.
bot_event = next(e for e in reversed(tracker.events) if e["event"] == "bot")
This will go through the reversed list of events (making it from latest to oldest) and pick the first bot event using the next() function.
The event will be have the following format:
{'event': 'bot', 'timestamp': 1601789469.174273, 'text': 'Hey! How are you?', 'data': {'elements': None, 'quick_replies': None, 'buttons': None, 'attachment': None, 'image': None, 'custom': None}, 'metadata': {}}
There you can simply take the 'text' param if you are only interested in the message.

Paypal Subscription Details Api is giving "Active" status although total cycles complete is 0

I am working with paypal subscription api v1. When an user subscribe to one of my plans on my website, the subscription_id is sent to my server. There I check the status and next billing date using the subscription details api to give the user some value. But when the user subscribes and my server checks for the status, the response it is getting is confusing. The response json is given below:
{'status': 'ACTIVE',
'status_update_time': '2019-11-13T09:36:35Z',
'id': '***',
'plan_id': '***',
'start_time': '2019-11-12T16:00:00Z',
'quantity': '1',
'shipping_amount': {'currency_code': 'USD', 'value': '0.0'},
'subscriber': {'name': **, 'email_address': '***', 'shipping_address': **},
'billing_info': {
'outstanding_balance': {'currency_code': 'USD', 'value': '0.0'},
'cycle_executions': [{
'tenure_type': 'REGULAR',
'sequence': 1,
'cycles_completed': 0,
'cycles_remaining': 0,
'current_pricing_scheme_version': 1,
'total_cycles': 0
}],
'next_billing_time': '2019-11-13T09:36:33Z',
'failed_payments_count': 0
},
'create_time': '2019-11-13T09:35:46Z',
'update_time': '2019-11-13T09:36:35Z',
Here you can see that the status is active but the next_billing_time is less than the status_update_time. And also no payment cycle is completed. Why paypal is behaving like this? I think the status should not be "ACTIVE" if the cycle is not complete. So why is it giving active status?

Access Denied when trying to do subqueries

I'm trying this query:
{'rest_data': '["sessionabc123xyz", "Meetings", "meetings.id IN (
SELECT mu.meeting_id FROM meetings_users mu WHERE mu.user_id = \'1\')", "",
0, [], 5, 0]', 'input_type': 'json', 'method': 'get_entry_list', 'response
_type': 'json'}
But I'm getting this as a response, even if I'm using an administrator account:
{u'description': u'You do not have access', u'name': u'Access De
nied', u'number': 40}
How can I retrieve a list of meetings (and calls) a user is participating in?
It seems it isn't possible with Sugar v6.4 http://developer.sugarcrm.com/2012/02/08/changes-to-web-services-api-in-sugarcrm-6-4-0/

SugarCRM Rest API: Required fields for a Meeting entry?

I'm trying to create a Meeting entry via the API, but I can't seem to find it in my calendar even though it saved successfully (I got the ID back) and I can see it in the Meetings list.
What fields do I need to populate for it to show in my Sugar calendar? Here are the fields I'm populating:
{
'assigned_user_id': '1', # My user's ID
'date_end': '2013-04-16 01:30:00',
'date_start': '2013-04-16 01:23:45',
'description': 'hello world',
'location': 'JCenter',
'name': 'Test',
'team_id': '1',
'type': 'Sugar' # This doesn't seem to be required
}
Try to set "user_id" and take a look into mettings_users table where you will find it.