Nextpagetoken not working as desired - c#

There are a lot of videos in the channel. Where as 'nextPageToken' only
iterates about 570 of them on my code.
Perhaps not a lib issue because the same happens on https://developers.google.com/youtube/v3/docs/search/list. After about only 10 pages the nextPageToken disappears.

You should using channel+playlistItems API to get ALL channel videos, not search API.
Kindly check it out on https://developers.google.com/youtube/v3/docs/channels/list#try-it.
Example, i set the channel id UCi-Lb1gFer4U7tkqFA1adiQ and part parameter as contentDetails.
the example of response is:
"items": [
{
"id": "UCi-Lb1gFer4U7tkqFA1adiQ",
"kind": "youtube#channel",
"etag": "\"NT-fDeVOLsFPouddIzcaWbd0fJw/sQKRHjGLTreNbWWrW3gIojOKiEk\"",
"contentDetails": {
"relatedPlaylists": {
"uploads": "UUi-Lb1gFer4U7tkqFA1adiQ"
}
}
}
]
Then you know the uploads playlist id now, UUi-Lb1gFer4U7tkqFA1adiQ, so you visit
https://developers.google.com/youtube/v3/docs/playlistItems/list
Put UUi-Lb1gFer4U7tkqFA1adiQ as the playlistId, then you would able to get all the videos by pagination.
p/s: please provide your channel id, if you still experience the problem

Related

Bot framework v4 hero card share button

I am working on building bot using v4 of bot framework. I have the functionality to share the hero card within the channel. i.e If the bot is deployed in facebook we need to share within the contacts same for skype too. How can I achieve this?
Desired output like this
Thanks in Advance.
Skype
Any card sent through Skype already has the functionality to be forwarded to other users. All the user has to do is press the forward button that displays on the side of the card. However, Skype does not support adding a share button directly on the card.
Facebook
You have to send a Messenger Template through the activity's channel data to include the share functionality on Facebook Messenger. In the template's element, you have to add a button with type element_share. See the example below.
await turnContext.sendActivity({
channelData: {
"attachment": {
"type": "template",
"payload": {
"template_type": "generic",
"elements": [
{
"title": "Three Strategies for Finding Snow",
"subtitle": "How do you plan a ski trip to ensure the best conditions? You can think about a resort’s track record, or which have the best snow-making machines. Or you can gamble.",
"image_url": "https://static01.nyt.com/images/2019/02/10/travel/03update-snowfall2/03update-snowfall2-jumbo.jpg?quality=90&auto=webp",
"default_action": {
"type": "web_url",
"url": "https://www.nytimes.com/2019/02/08/travel/ski-resort-snow-conditions.html",
"messenger_extensions": false,
"webview_height_ratio": "tall"
},
"buttons": [{
"type":"element_share"
}]
}
]
}
}
}
});
Hope this helps!

Facebook graph api 2.9 get total count of friends only

I can get JSON with all fields related to user_friends scope. However, from version 2.0 API returns mostly empty data[](if non of user's friend uses this app). Currently what I get is:
"friends": {
"data": [],
"summary": {
"total_count": 142
}
}
I want to extract only summary with total count of user's friends. So what I want to get is
"friends": {
"summary": {
"total_count": 142
}
}
Is this even possible?
I didn't find anything helpful about this in documentation, so any help is appreciated.

Google Youtube API provides wrong data

I have a trouble with YouTube API. I have an experience in many API services and first time I encountered such strange work of this API.
Problem description:
First, I want to get subscribers of my channel. I'm developing this tool for my friend, but I take my own channel for testing purposes. So, doesn't matter how (through Web Interface of my C# tool), but I always get wrong data about my subscribers.
This is my json response:
...
"pageInfo": {
"totalResults": 17,
"resultsPerPage": 5
}, ...
Actual count of subscribers is 17. It is ok. But next, I have a list with subscribers description:
"items": [
{
"kind": "youtube#subscription",
"etag": "...",
"id": "...",
"subscriberSnippet": {
"title": "chris chandler",
"description": "",
"channelId": "UCbl-PjR7SwAQkGi2nUlZbMg",
...
}
},
And count of this blocks is 8.
I tried to set maxResults to 50 for getting all results in one page. But I always have 8 subscribers. I don't know why.
I tried tool with my friend's account. His actual count of subscribers is 385. But API shows only 301. Also I tried to get list of my subscriptions. Actual it is 107, but I get only about 80.
I've tested it with Web interface here:
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.subscriptions.list?part=subscriberSnippet&maxResults=5&mySubscribers=true
P.S. You can think, that some of YouTube data doesn't update momentarily. But I have constant amount of subscribers on my test channel about 3 years (It is about channel with 17 subscribers).

PayPal Rest API - Update Billing Plan Return URL

I have been using the PayPal Rest API and have successfully created and activated a BillingPlan but I'm having trouble updating said plan's return_url. I think it's something to do with the JSON path I'm using although I'm not sure why!?
Anyway, I am calling the update plan method: https://developer.paypal.com/docs/api/#update-a-plan
A BillingPlan follows the format:
{
"id": "P-94458432VR012762KRWBZEUA",
"state": "ACTIVE",
"name": "T-Shirt of the Month Club Plan",
"description": "Template creation.",
"type": "FIXED",
...
"merchant_preferences": {
"setup_fee": {
"currency": "USD",
"value": "1"
},
"max_fail_attempts": "0",
"return_url": "http://example.com",
"cancel_url": "http://example.com",
"auto_bill_amount": "YES",
"initial_fail_amount_action": "CONTINUE"
},
...
}
I'm using the C# SDK but my request JSON should look very much like:
{
"path": "merchant_preferences",
"value": {
"return_url": "http://example.com/payment/return"
},
"op": "replace"
}
I keep getting responses along the line's of:
{"name":"BUSINESS_VALIDATION_ERROR","details":[{"field":"validation_error","issue":"Invalid
Path provided."}],"message":"Validation
Error.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#BUSINESS_VALIDATION_ERROR","debug_id":"2ae68f9f0aa72"}
To sum up - I want to change the billing plan return_url from http://example.com to http://example.com/payment/return.
I've changed the path to various things to no avail. Can anyone help??
You cannot update the plan, once it is set to active. The reason for that restriction is that because there could be possible agreements based on that plan, modifying it would affect the already agreed billing agreements.
However, I agree with your problem statement, that changing the Return URL should not be an issue as this is not a part of agreement, but more of a configuration change. It would be nice to somehow allow updating similar settings in Plan, even after active. I will let the API team know about that.
however, in the mean time, there is no way you would be able to do that. Alternatively, you could possibly create a new plan, and use that instead. Not the answer you are looking for, but a probable solution.

How to get public's image via facebook api?

I want to show newsfeed from facebook in my wp8 app. I made a query to Graph API "me/home", an got a newsfeed. And I need an image of each authors of feed. For example a have a piese of newsfeed look like
"id": "107619212653885_433558870059916",
"from": {
"category": "News/media website",
"name": "ФОКУС",
"id": "107619212653885"
},
"message": "Дарт Вейдер никак не угомонится. Завтра будет поздравлять прекрасных дам. http://focus.ua/kiev/263541/\r\n\r\n8 марта было в \"Звездных войнах\"?",
In "from" I have id, and if I use query
107619212653885?fields=cover
I can get a cover's "source". Here the link of this public. But, in source - picture with snowdrops, and I need a picture with red "Ф", because in newsfeed I see this picture, not with snowdrops. So, how can I get this picture?
Answer 107619212653885/picture
For this you will need the user id. With the user_id you can get the image of the user through a GET call.
example
string uid
stream response
HTTP1.Get ('http://graph.facebook.com/' + uid/picture?redirect=false, response)

Categories