Because the Json returned by the instagram API Graph does not arrive full

0

I am currently trying to read the images posted with a hashtag in instagram, the connection has been made correctly, user_id, token etc, but when the Json arrives with the content is not complete, obviously causing an error when reading it. .

With this code I am the request

val request = GraphRequest.newGraphPathRequest(
            AccessToken.getCurrentAccessToken(), "/$id_hashtag/recent_media") {

        Log.i("prueba", it.rawResponse)
        cargarImagenes(it.rawResponse)

    }
    val parameters = Bundle()
    parameters.putString("fields", "id,media_url")
    parameters.putString("user_id", user_business)
    parameters.putString("access_token", accessToken)
    request.parameters = parameters
    request.executeAsync()

The Json code arrives like this

I/prueba: json {"data":[{"id":"17879016673301038","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/44505700_116694249229446_196686400799774775_n.jpg?_nc_cat=106&_nc_ht=scontent.xx&oh=a17aa84595722be1c08b753657fbd8c8&oe=5C490266"},{"id":"17973383677088880","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t50.2886-16\/45305283_1892467367468089_4921130908796321792_n.mp4?_nc_cat=104&_nc_ht=scontent.xx&oh=6921c0229fe014c1b02ac4e5c6e34916&oe=5C74D3DB"},{"id":"17994829429030214","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/43779125_250402522297145_2487324873411997879_n.jpg?_nc_cat=106&_nc_ht=scontent.xx&oh=80c2938a75ad35f0d24e82849513e4ff&oe=5C7DB69E"},{"id":"17981922190103320","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t50.2886-16\/44825704_702996180071452_7022988960261295202_n.mp4?_nc_cat=109&_nc_ht=scontent.xx&oh=d4c012db00436ea652208ff8dba148c5&oe=5C461B82"},{"id":"17973346195086449","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t50.2886-16\/43341338_1001940719993872_8547951308156436480_n.mp4?_nc_cat=105&_nc_ht=scontent.xx&oh=6523d879e0c439121f24e8cd6c007efd&oe=5C7392A3"},{"id":"17935443445206022","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/43630902_114876656094443_688509992258558768_n.jpg?_nc_cat=104&_nc_ht=scontent.xx&oh=375606c7115ae08ab7afff243220458f&oe=5C432164"},{"id":"17966400955178239","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/43913758_368840533657065_8696421553495360377_n.jpg?_nc_cat=111&_nc_ht=scontent.xx&oh=964cbcc46f0f244688775a70bc33ce21&oe=5C767DCA"},{"id":"17953379692199174","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/44233771_278532922794855_5811285217831572769_n.jpg?_nc_cat=101&_nc_ht=scontent.xx&oh=d1c64f01003c0c92821b7a37597ccf8a&oe=5C3E7C29"},{"id":"17865081826294415","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/42135254_2155778244466997_8872423641236703200_n.jpg?_nc_cat=108&_nc_ht=scontent.xx&oh=8e4097ca1cacc8c678f64050d9ed86cd&oe=5C73697D"},{"id":"17996543644057740","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t50.2886-16\/45104268_280118919296840_353127871536954162_n.mp4?_nc_cat=101&_nc_ht=scontent.xx&oh=c44c063203efec0c5a91a9d5a688f40c&oe=5C494752"},{"id":"17918345224246604","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t50.2886-16\/45240065_343588082855925_3755623505039720448_n.mp4?_nc_cat=109&_nc_ht=scontent.xx&oh=4956c2fe3f803e49a1d14683e98e6e4c&oe=5C3E0D37"},{"id":"17969881594139027","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/44564675_128966621418237_7867824393345484629_n.jpg?_nc_cat=105&_nc_ht=scontent.xx&oh=b9c7e4cf4727dd925effc358346d99ae&oe=5C7AD486"},{"id":"17995870147033739","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/43984977_2135196353168852_8953610551331950718_n.jpg?_nc_cat=100&_nc_ht=scontent.xx&oh=0f131c50330285e720960c027d977f0e&oe=5C3E9712"},{"id":"17995833229002500","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/44589493_385766718659416_8272506145338872239_n.jpg?_nc_cat=106&_nc_ht=scontent.xx&oh=6f4a8366ffd1c6b3410b0d98549031c7&oe=5C89164A"},{"id":"17996764441024943","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/43820614_347890992452822_2139869202855917778_n.jpg?_nc_cat=111&_nc_ht=scontent.xx&oh=f55b393fb359510ad0e6caa2cf6c1c48&oe=5C897193"},{"id":"17994450586021793","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/44421098_259069258140455_5071605228813729932_n.jpg?_nc_cat=101&_nc_ht=scontent.xx&oh=137ec0022b00c780741b6da6ac3fbf1f&oe=5C7992E5"},{"id":"17977774009126623","media_url":"https:\/\/scontent.xx.fbcdn.net\/v\/t51.2885-15\/44419986_542317752860800_9048757298264960056_n.jpg?_nc_cat=103&_nc_ht=scontent.xx&oh=856fd42efb0eb9b05ed31f2ccd6a0027&oe=5C8033BB"}],"paging":{"cursors":{"after":"--------------},"next":"https:\/\/graph.facebook.com\/v3.2\/----MI-ID-----\/recent_media?access_token=EAAfCUiF4ozwBAEr

When doing the test with the tool of Api Graph Explorer of facebook works well and in the console (of the tool) it correctly returns all the complete Json. Thank you very much

I put the Java tag because if I find the solution in java or kotlin I use both languages.

    
asked by Leonardo Henao 03.11.2018 в 03:02
source

0 answers