Instagram-private-api: How to check n械w m械ssag械s?

Created on 25 Jun 2017  路  6Comments  路  Source: dilame/instagram-private-api

Hey! I've got a list of all threads and I want to know which is seen and which are not.
Which feeld is responsible for that?
direct_v2/inbox/ shows only last item and last_seen_at timestamp, username and other stuff.
No any field to detect if message had been read.
Any solution?

Most helpful comment

@CashCode @diegofcoelho
I can share my frontend code with you, i hope you can understand it

const itemLastSeen = _.get(this.get('itemsSeenAt'),_.findLastKey(this.get('itemsSeenAt')));
const lastSeenAt = _.isUndefined(itemLastSeen) ? 0 : itemLastSeen.timestamp;
this.set('unread', this.get('lastActivityAt') > lastSeenAt);

All 6 comments

Not answering your question, but I have a problem with another InstagramAPI that also uses "direct_v2/inbox/" endpoint but returns only the last message sent and unread. Are you able to get all messages using this NODE.JS api?

Nope, I didnt use it. It's general api question.

@diegofcoelho I'm looking for that behavior, what API are you using?

@CashCode @diegofcoelho
I can share my frontend code with you, i hope you can understand it

const itemLastSeen = _.get(this.get('itemsSeenAt'),_.findLastKey(this.get('itemsSeenAt')));
const lastSeenAt = _.isUndefined(itemLastSeen) ? 0 : itemLastSeen.timestamp;
this.set('unread', this.get('lastActivityAt') > lastSeenAt);

@CashCode I'm having a similar problem. How were you able to get a list of all the threads? What does your code look like

Okay, @dilame code worked in earlier version. But now in inbox I see unseen_count field, and unseen_count_ts field. Can I get thread with this new message directly in current version, or I must iterate over all threads and check lastSeen fields?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zalkanorr picture zalkanorr  路  12Comments

ozican picture ozican  路  143Comments

sagardalal21 picture sagardalal21  路  39Comments

DKertson16 picture DKertson16  路  10Comments

theonlygusti picture theonlygusti  路  11Comments