无法在 Evernote 中创建笔记本和传输文件
我正在开发一个 Web 应用程序,我需要创建一个 EverNote 笔记本并在其中传输一些文件。
我能够从 EverNote 验证用户身份,但无法创建笔记本。我也很困惑如何在该笔记本中传输文件。
这是验证码。 API URL
用于创建笔记本:
noteStore.createNotebook(access_token.token, "my_notebook")
错误:
An error occurred: undefined method `write' for "my_notebook":String
编辑
跟随 seth
notebook = Evernote::EDAM::Type::Notebook.new()
notebook.name = "my_notebook3"
x= noteStore.createNotebook(access_token.token, notebook)
note = Evernote::EDAM::Type::Note.new()
note.notebookGuid = x.guid
note.title="my note"
y=noteStore.createNote(access_token.token,note)
在该说明中领导的文件传输工作。
I am developing a web application and I need to create an EverNote notebook and transfer some files in it.
I am able to authenticate user from EverNote but not able to create notebook. I'm also confused how to transfer files in that notebook.
Here is the authentication code. API URL
For creating a notebook:
noteStore.createNotebook(access_token.token, "my_notebook")
Error:
An error occurred: undefined method `write' for "my_notebook":String
edit
following seth's lead
notebook = Evernote::EDAM::Type::Notebook.new()
notebook.name = "my_notebook3"
x= noteStore.createNotebook(access_token.token, notebook)
note = Evernote::EDAM::Type::Note.new()
note.notebookGuid = x.guid
note.title="my note"
y=noteStore.createNote(access_token.token,note)
working on file transfer in that note.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第二个参数是 Notebook 结构,而不是字符串。您需要执行以下操作:
Evernote 笔记本仅包含注释,并且注释可以附加文件。要将文件附加到新笔记,您需要创建一个资源并将其包含在笔记中:
Evernote API ZIP 文件中的示例代码演示了这一点。您可以从 http://www.evernote.com/about/developer/api/ 下载 ZIP 。
The second parameter is a Notebook structure, not a string. You need to do something like:
Evernote notebooks contain only Notes, and Notes can have files attached to them. To attach a file to a new note, you need to create a Resource and include it in the note:
The sample code in the Evernote API ZIP file demonstrates this. You can download the ZIP from http://www.evernote.com/about/developer/api/.