Jump to content
Introducing 'Templates' for Evernote Read more... ×
Notebook Limit Increase Read more... ×

Vasu Kevin

Member +
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

2 Neutral

Recent Profile Visitors

1,788 profile views
  1. Vasu Kevin

    How to get resource id with hash value?

    Hi , Am getting error with this scenario am trying to convert the hex hash to binary hash with the below code but after passing the converted value to the method getting the exception, EDAMNotFoundException(identifier:Resource, key:xxxxxx) param = hex hash value; String binaryHash = new BigInteger(param,16).toString(2); binaryHash = String.format("%64s", binaryHash).replace(" ", "0"); byte[] hashByteArray = binaryHash.getBytes(); resource = noteStore.getResourceByHash(noteId, hashByteArray, true, true, false); @phils can you guide me over this?
  2. Vasu Kevin

    How to get resource id with hash value?

    Hi , Am using java i searched in forum too, Couldn't get the exact way.
  3. Vasu Kevin

    displaying note content with resources?

    Hi @matthewayne, I wanna know how to convert hash which is in en-media content to hash which is required in NoteStore.getResourceByHash in java , Is ther any sample code to convert the above? hexhash to binary hash ?
  4. Hi , While i retrieve the note content with fullNote.getContent() , with this i have note content as <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">\n<en-note><div><br clear=\"none\"><\/div><div><br clear=\"none\"><\/div><div>i have planned a get together this sunday.<\/div><div><br clear=\"none\"><\/div><div><br clear=\"none\"><en-media hash=\"4ed3a2173c001dc52a5b5d36883b0c\" type=\"image/jpeg\"><\/en-media><\/div><div><br clear=\"none\"><\/div><div><br clear=\"none\"><\/div><div><br clear=\"none\"><\/div><div><br clear=\"none\"><\/div><div><br clear=\"none\"><\/div><div>text eneterd after image<\/div><div><br clear=\"none\"><en-media hash=\"d021f0bfaaec9c1e1c60d4f85d2a9\" type=\"image/png\"><\/en-media><\/div><div><br clear=\"none\"><en-media hash=\"8115aa071363a16f6c2fb308a6589\" type=\"image/png\"><\/en-media><\/div><br><en-media hash=\"767a5492f006873535993ff38b5801\" type=\"image/jpeg\"><\/en-note> since this note has both text and resource (attachment), and its in correct order, 1.How to replace the exact hash value within the <en-media> with the corresponding attachment content { where i can download the attachment with resources-id }, but in turn i have only hash value, is there anyway that we can get the id of the resource with the hash value we get in the note content. 2. getResourceByHash(String noteGuid, byte[] contentHash, boolean withData, boolean withRecognition, boolean withAlternateData) , or i have any alternative so that i can pass my hash to this method by converting
  5. Hi matthewayne, One more question : We get the the note-guid , User-id and Notebook-guid once the changes occur for the user's through web-hooks , * How to get, what are the changes occured in that particular note or notebook (using their Id ), Is that i want to call polling Api to get changes happened ?
  6. Thanks matthewayne, Ya as u said we have started filtering the web-hooks user's through their Id we get once notified , But it will be very useful when we have Api for registered web-Hooks users later.
  7. Hi , mattheway can u guide me in this topic , Am helpless.
  8. Hi Everyone, Any update on this ?, Am waiting for this. @
  9. Hi Everyone, I have created a new web hook for My-app , So as the response the Url ( e.g => https://baseurl.pushnotification/evernote) is getting notified when ever the changes happens in notes for all users who have authenticated my app, Question is , 1.Is that i can get notification only for the users whom i want (i.e the users who wants web hook to be activated )? 2.Is that i can get notification only for particular notebook or note for a particular user?
  10. Hi Matthewayne, I have made it working ,As you directed i have changed the code with slight modification its working fine for me, Thank You, Here is my changed code for reference, noteToBeAttached = noteStore.getNote(noteGuid, true, true, true, true); Data dataObj = new Data(); ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream(); byte[] block=new byte[10240]; int len; while ((len=fileInputStreamData.read(block)) >= 0) { byteArrayStream.write(block,0,len); } byte[] body=byteArrayStream.toByteArray(); dataObj.setSize(body.length); dataObj.setBodyHash(MessageDigest.getInstance("MD5").digest(body)); dataObj.setBody(body); fileInputStreamData.close(); Resource resource=new Resource(); resource.setData(dataObj); resource.setMime(mp.getContentType(file)); ResourceAttributes attributes = new ResourceAttributes(); attributes.setAttachment(true); attributes.setFileName(""); resource.setAttributes(attributes); String hashHex = bytesToHex(resource.getData().getBodyHash()); String content = noteToBeAttached.getContent(); FileType = mp.getContentType(file); String xmlContent [] = content.split("</en-note>"); String newContentForAttachment = "<div><br/></div><en-media type=\""+FileType+"\" hash=\"" + hashHex + "\"/></en-note>"; content = xmlContent[0]+""+newContentForAttachment; noteToBeAttached.addToResources(resource); noteToBeAttached.setContent(content); noteStore.updateNote(noteToBeAttached); }
  11. Hi , I have added a new resource (attachement) to the existing note, where that corresponding note has already two attachments in it, when i add the new resource (attachment) to the note , the existing resources are getting vanished in that note, have tried everything said in the discussions ,but couldn't make it up, don't know where am going wrong, Here is my code sample, // creating a note object Note noteToBeAttached =null; noteToBeAttached = noteStore.getNote("y273y8y7e9238h82hr829y", true, true, true, true); FileInputStream fileInputStreamData = new FileInputStream(file object to be attached); Data dataObj = new Data(); ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream(); byte[] block=new byte[10240]; int len; while ((len=fileInputStreamData.read(block)) >= 0) { byteArrayStream.write(block,0,len); } byte[] body=byteArrayStream.toByteArray(); dataObj.setSize(body.length); dataObj.setBodyHash(MessageDigest.getInstance("MD5").digest(body)); dataObj.setBody(body); fileInputStreamData.close(); Resource resource=new Resource(); resource.setData(dataObj); resource.setMime(mp.getContentType(file)); ResourceAttributes attributes = new ResourceAttributes(); attributes.setAttachment(true); attributes.setFileName("abcd"); resource.setAttributes(attributes);\ String hashHex = bytesToHex(resource.getData().getBodyHash()); String content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">" + "<en-note>" + "<span style=\"color:green;\">my vasu new content:</span><br/>" + "<en-media type=\""+mp.getContentType(file)+"\" hash=\"" + hashHex + "\"/>" + "</en-note>"; noteToBeAttached.addToResources(resource); noteToBeAttached.setContent(content); noteStore.updateNote(noteToBeAttached); It works fine but the problem is already existing resources are getting deleted, only one new added attachment is remaining in that note,
  12. Hi, Can i get the same sample code in java , Scenario: i wanna add a resource (An attachment ) to already existing notes is there any possibilities available ....
  13. hi , i have completed my development in sandbox mode and its working fine now i have to move my development to production mode from sandbox mode, i have changed all necessary changes like... https://sandbox.evernote.com/ as https://www.evernote.com/ EvernoteAuth evernoteAuth = new EvernoteAuth(EvernoteService.SANDBOX, authtoken); as EvernoteAuth evernoteAuth = new EvernoteAuth(EvernoteService.PRODUCTION, authtoken); but its not working dont no wat to do its throwing an exception as Servlet.service() for servlet default threw exception|java.io.IOException: Server returned HTTP response code: 401 for URL: https://www.evernote.com/oauth?oauth_consumer_key=&oauth_signature=&oauth_signature_method=PLAINTEXT&oauth_timestamp=&oauth_nonce=&oauth_callback=
  14. Vasu Kevin

    Retrieve notes which has resources

    hi, thanks for reply can u say how to use the , any: resource:image/* resource:audio/* resource:application/* in java code it would be great if you provide me a code example for this.
×