Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
get resources by note id
Browse files Browse the repository at this point in the history
  • Loading branch information
foxmask committed Oct 24, 2019
1 parent 1688a51 commit d02f06a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion joplin_api/__init__.py
Expand Up @@ -6,4 +6,4 @@

from .core import JoplinApi

__version__ = "1.5.2"
__version__ = "1.5.3"
14 changes: 14 additions & 0 deletions joplin_api/core.py
Expand Up @@ -38,6 +38,10 @@ class JoplinApi:
folder_props = 'id, title, created_time, updated_time, user_created_time, user_updated_time, ' \
'encryption_cipher_text, encryption_applied, parent_id'

resource_props = 'id, title, mime, filename, created_time, updated_time, ' \
'user_created_time, user_updated_time, file_extension, encryption_cipher_text,' \
'encryption_applied, encryption_blob_encrypted, size'

def __init__(self, token, **config):
"""
:param token: string The API token grabbed from the Joplin config page
Expand Down Expand Up @@ -148,6 +152,16 @@ async def get_notes_tags(self, note_id):
path = f'/notes/{note_id}/tags'
return await self.query('get', path, self.note_props)

async def get_notes_resources(self, note_id):
"""
GET /notes/:id/resources
get all the resources of this note
:return: res: result of the get
"""
path = f'/notes/{note_id}/resources'
return await self.query('get', path, self.resource_props)

async def create_note(self, title, body, parent_id, **kwargs):
"""
POST /notes
Expand Down

0 comments on commit d02f06a

Please sign in to comment.