LineAPI

Introduction

This is a python wrapper of official LINE thirft API. There are other functions which is not implemented to line like kickoutFromGroup things, so you can add other API here and use it as your way.

LineAPI

class line.LineAPI

This class is a wrapper of LINE API

_acceptGroupInvitation(groupId, seq=0)

Accept a group invitation

_cancelGroupInvitation(groupId, contactIds=[], seq=0)

Cancel a group invitation

_createGroup(name, ids, seq=0)

Create a group

_createRoom(ids, seq=0)

Create a chat room

_findAndAddContactsByEmail(emails, seq=0)

Find and add contacts by email

_findAndAddContactsByMid(mid, seq=0)

Find and add contacts by Mid

_findAndAddContactsByPhone(phones, seq=0)

Find and add contacts by phone

_findAndAddContactsByUserid(userid, seq=0)

Find and add contacts by Userid

_findContactByUserid(userid)

Find contacts by Userid

_findContactsByEmail(emails)

Find contacts by email

_findContactsByPhone(phones)

Find contacts by phone

_getAllContactIds()

Get all contacts of your LINE account

_getBlockedContactIds()

Get all blocked contacts of your LINE account

_getContacts(ids)

Get contact information list from ids

Returns:List of Contact list - status - capableVideoCall - dispalyName - settings - pictureStatus - capableVoiceCall - capableBuddy - mid - displayNameOverridden - relation - thumbnailUrl - createdTime - facoriteTime - capableMyhome - attributes - type - phoneticName - statusMessage
_getGroupIdsInvited()

Get group id that you invited

_getGroupIdsJoined()

Get group id that you joined

_getGroups(ids)

Get a list of group with ids

_getProfile()

Get profile information

Returns:Profile object - picturePath - displayName - phone (base64 encoded?) - allowSearchByUserid - pictureStatus - userid - mid # used for unique id for account - phoneticName - regionCode - allowSearchByEmail - email - statusMessage
_getRecentMessages(id, count=1)

Get recent messages from id

_getRoom(id)

Get a chat room

_get_json(url)

Get josn from given url with saved session and headers

_inviteIntoGroup(groupId, contactIds=[], seq=0)

Invite contacts into group

_inviteIntoRoom(roomId, contactIds=[])

Invite contacts into room

_leaveGroup(id)

Leave a group

_leaveRoom(id)

Leave a chat room

_sendMessage(message, seq=0)

Send a message to id. id could be contact id or group id

Parameters:messagemessage instance
get_json(url)

Get josn from given url with saved session and headers

login()

Login to LINE server.

raise_error(msg)

Error format

ready()

After login, make client and client_in instance to communicate with LINE server

updateAuthToken()

After login, update authToken to avoid expiration of authToken. This method skip the PinCode validation step.