Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

comments always null #213

Open
sergio11 opened this issue Nov 16, 2017 · 0 comments
Open

comments always null #213

sergio11 opened this issue Nov 16, 2017 · 0 comments

Comments

@sergio11
Copy link

sergio11 commented Nov 16, 2017

HI,

I need to use your library to get all the comments that the authenticated user has received in all their publications.

The application is in sandbox mode, both the user who owns the "accessToken" that I am using and the users who have made comments are registered in sandbox mode.

If I used the API manually used the access token, I get all the comments:

https://api.instagram.com/v1/media/1648520120576748585_6282056973/comments?access_token=accessToken

But when using your library (version 1.2.2) as follows, the "comments" field is always null.

Instagram instagram = new Instagram(accessToken, appSecret);
            UserInfoData userInfo = instagram.getCurrentUserInfo().getData();
            
        	logger.debug("User Fullname -> " + userInfo.getUsername());
            logger.debug("User Id -> " + userInfo.getId());
            
            MediaFeed mediaFeed = instagram.getUserRecentMedia();
            
            logger.debug("MediaFeed -> " + mediaFeed.toString());
            
            for(final MediaFeedData mediaFeedData: mediaFeed.getData()){
            	logger.debug("Media Feed Data -> " + mediaFeedData.toString());
            	logger.debug("Comments -> " + mediaFeedData.getComments());
            	
            }

It tells me, for example, that a publication has two comments but I do not get them:

Comments -> Comments [comments=null, count=2]

[on-pool-thread3] org.jinstagram.InstagramBase             : Getting current user info...
2017-11-16 13:07:52.695 DEBUG 66495 --- [on-pool-thread2] e.b.u.b.r.s.impl.InstagramServiceImpl    : MediaFeed -> MediaFeed [data=[MediaFeedData [caption=null, comments=Comments [comments=null, count=2], createdTime=1510738934, id=1648520120576748585_6282056973, imageFilter=Normal, images=Images [lowResolution=ImageData [imageHeight=320, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s320x320/e35/23498645_143091532990822_9018320668827058176_n.jpg, imageWidth=320], standardResolution=ImageData [imageHeight=640, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/23498645_143091532990822_9018320668827058176_n.jpg, imageWidth=640], thumbnail=ImageData [imageHeight=150, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/23498645_143091532990822_9018320668827058176_n.jpg, imageWidth=150]], likes=Likes [count=0, likesUserList=null], link=https://www.instagram.com/p/BbguFDAD6wp/, location=null, tags=[], type=image, user=User [bio=null, fullName=Grupo Bisite, id=6282056973, profilePictureUrl=https://scontent.cdninstagram.com/t51.2885-19/s150x150/23421959_365191280600494_420392017407770624_n.jpg, userName=grupobisite, websiteUrl=null], userHasLiked=false, usersInPhoto=[]], MediaFeedData [caption=null, comments=Comments [comments=null, count=1], createdTime=1510738903, id=1648519865907010350_6282056973, imageFilter=Normal, images=Images [lowResolution=ImageData [imageHeight=320, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s320x320/e35/23596658_1715713398479271_1882712937269821440_n.jpg, imageWidth=320], standardResolution=ImageData [imageHeight=640, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/23596658_1715713398479271_1882712937269821440_n.jpg, imageWidth=640], thumbnail=ImageData [imageHeight=150, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/23596658_1715713398479271_1882712937269821440_n.jpg, imageWidth=150]], likes=Likes [count=1, likesUserList=null], link=https://www.instagram.com/p/BbguBV0j9su/, location=null, tags=[], type=image, user=User [bio=null, fullName=Grupo Bisite, id=6282056973, profilePictureUrl=https://scontent.cdninstagram.com/t51.2885-19/s150x150/23421959_365191280600494_420392017407770624_n.jpg, userName=grupobisite, websiteUrl=null], userHasLiked=false, usersInPhoto=[]], MediaFeedData [caption=null, comments=Comments [comments=null, count=5], createdTime=1510738867, id=1648519565334764584_6282056973, imageFilter=Normal, images=Images [lowResolution=ImageData [imageHeight=320, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s320x320/e35/23498620_511473632550353_9037526697422880768_n.jpg, imageWidth=320], standardResolution=ImageData [imageHeight=640, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/23498620_511473632550353_9037526697422880768_n.jpg, imageWidth=640], thumbnail=ImageData [imageHeight=150, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/23498620_511473632550353_9037526697422880768_n.jpg, imageWidth=150]], likes=Likes [count=2, likesUserList=null], link=https://www.instagram.com/p/Bbgt895D1wo/, location=null, tags=[], type=image, user=User [bio=null, fullName=Grupo Bisite, id=6282056973, profilePictureUrl=https://scontent.cdninstagram.com/t51.2885-19/s150x150/23421959_365191280600494_420392017407770624_n.jpg, userName=grupobisite, websiteUrl=null], userHasLiked=true, usersInPhoto=[]]], meta=Meta [code=200, errorMessage=null, errorType=null], pagination=Pagination [depreciationWarning=null, minTagId=null, nextMaxId=null, nextMaxTagId=null, nextMinId=null, nextUrl=null]]
2017-11-16 13:07:52.695 DEBUG 66495 --- [on-pool-thread2] e.b.u.b.r.s.impl.InstagramServiceImpl    : Media Feed Data -> MediaFeedData [caption=null, comments=Comments [comments=null, count=2], createdTime=1510738934, id=1648520120576748585_6282056973, imageFilter=Normal, images=Images [lowResolution=ImageData [imageHeight=320, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s320x320/e35/23498645_143091532990822_9018320668827058176_n.jpg, imageWidth=320], standardResolution=ImageData [imageHeight=640, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/23498645_143091532990822_9018320668827058176_n.jpg, imageWidth=640], thumbnail=ImageData [imageHeight=150, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/23498645_143091532990822_9018320668827058176_n.jpg, imageWidth=150]], likes=Likes [count=0, likesUserList=null], link=https://www.instagram.com/p/BbguFDAD6wp/, location=null, tags=[], type=image, user=User [bio=null, fullName=Grupo Bisite, id=6282056973, profilePictureUrl=https://scontent.cdninstagram.com/t51.2885-19/s150x150/23421959_365191280600494_420392017407770624_n.jpg, userName=grupobisite, websiteUrl=null], userHasLiked=false, usersInPhoto=[]]
2017-11-16 13:07:52.695 DEBUG 66495 --- [on-pool-thread2] e.b.u.b.r.s.impl.InstagramServiceImpl    : Comments -> Comments [comments=null, count=2]
2017-11-16 13:07:52.695 DEBUG 66495 --- [on-pool-thread2] e.b.u.b.r.s.impl.InstagramServiceImpl    : Media Feed Data -> MediaFeedData [caption=null, comments=Comments [comments=null, count=1], createdTime=1510738903, id=1648519865907010350_6282056973, imageFilter=Normal, images=Images [lowResolution=ImageData [imageHeight=320, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s320x320/e35/23596658_1715713398479271_1882712937269821440_n.jpg, imageWidth=320], standardResolution=ImageData [imageHeight=640, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/23596658_1715713398479271_1882712937269821440_n.jpg, imageWidth=640], thumbnail=ImageData [imageHeight=150, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/23596658_1715713398479271_1882712937269821440_n.jpg, imageWidth=150]], likes=Likes [count=1, likesUserList=null], link=https://www.instagram.com/p/BbguBV0j9su/, location=null, tags=[], type=image, user=User [bio=null, fullName=Grupo Bisite, id=6282056973, profilePictureUrl=https://scontent.cdninstagram.com/t51.2885-19/s150x150/23421959_365191280600494_420392017407770624_n.jpg, userName=grupobisite, websiteUrl=null], userHasLiked=false, usersInPhoto=[]]
2017-11-16 13:07:52.695 DEBUG 66495 --- [on-pool-thread2] e.b.u.b.r.s.impl.InstagramServiceImpl    : Comments -> Comments [comments=null, count=1]
2017-11-16 13:07:52.696 DEBUG 66495 --- [on-pool-thread2] e.b.u.b.r.s.impl.InstagramServiceImpl    : Media Feed Data -> MediaFeedData [caption=null, comments=Comments [comments=null, count=5], createdTime=1510738867, id=1648519565334764584_6282056973, imageFilter=Normal, images=Images [lowResolution=ImageData [imageHeight=320, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s320x320/e35/23498620_511473632550353_9037526697422880768_n.jpg, imageWidth=320], standardResolution=ImageData [imageHeight=640, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/23498620_511473632550353_9037526697422880768_n.jpg, imageWidth=640], thumbnail=ImageData [imageHeight=150, imageUrl=https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/23498620_511473632550353_9037526697422880768_n.jpg, imageWidth=150]], likes=Likes [count=2, likesUserList=null], link=https://www.instagram.com/p/Bbgt895D1wo/, location=null, tags=[], type=image, user=User [bio=null, fullName=Grupo Bisite, id=6282056973, profilePictureUrl=https://scontent.cdninstagram.com/t51.2885-19/s150x150/23421959_365191280600494_420392017407770624_n.jpg, userName=grupobisite, websiteUrl=null], userHasLiked=true, usersInPhoto=[]]
2017-11-16 13:07:52.696 DEBUG 66495 --- [on-pool-thread2] e.b.u.b.r.s.impl.InstagramServiceImpl    : Comments -> Comments [comments=null, count=5]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant