actualNoteContentPart: ## app.getAttachmentURL
  Given the UUID of an attachment, returns a temporary URL that can be used to access the attachment. The client must be online for this function to succeed.
  Arguments
  	String [attachment](/help/developing_amplenote_plugins/appendix_i#attachment)  UUID identifying the attachment
  Returns
  	String temporary URL that can be used to access the attachment content
  ```
  {  async noteOption(app, noteUUID) {    const attachments = await app.getNoteAttachments({ uuid: noteUUID });    if (attachments.length > 0) {      const attachmentURL = await app.getAttachmentURL(attachments[0].uuid);      await app.alert("URL: " + attachmentURL);    } else {      await app.alert("Note doesn't have any attachments");    }  }}
  ```
  
  ### Example: reading attachment content
  Note that the web environment plugin code executes in requires a server to respond with CORS headers, and the attachments server does not add these headers for the plugin code origin. The attachments server address is allowed through a plugin CORS proxy that adds the appropriate headers, so it can be used to fetch attachment data.
  ```
  {  async noteOption(app, noteUUID) {    const attachments = await app.getNoteAttachments({ uuid: noteUUID });    if (attachments.length === 0) {      await app.alert("Note doesn't have any attachments");      return;    }     const attachmentURL = await app.getAttachmentURL(attachments[0].uuid);     const proxyURL = new URL("https://plugins.amplenote.com/cors-proxy");    proxyURL.searchParams.set("apiurl", attachmentURL);     const response = await fetch(proxyURL);    const attachmentContent = await response.text();     await app.alert("Attachment text content: " + attachmentContent);  }}
  ```
  
  ## app.getCompletedTasks
  Gets tasks completed in the given time range, which includes standard completed, dismissed, and crossed-out tasks.
  Arguments
  	integer unix timestamp, only tasks completed on or after this time will be returned
  	integer unix timestamp, only tasks completed before this time (non-inclusive) will be returned
  Returns
  	Array of [task](/help/developing_amplenote_plugins/appendix_i#task)  objects describing the completed tasks
  ```
  {  async appOption(app) {    const to = Math.floor(Date.now() / 1000); // now    const from = to - (60 * 60 * 24); // 1 day ago     const completedTasks = await app.getCompletedTasks(from, to);    await app.alert("Completed task count: " + completedTasks.length);  }} 
  ```
  
  ## app.getMoodRatings
  Arguments
  	integer unix timestamp, only ratings left on or after this time will be included in the results
  	(optional) integer unix timestamp, only ratings left before this time will be included in the results
  Returns
  	Array of [moodRating](/help/developing_amplenote_plugins/appendix_i#moodRating)  objects
  ```
  {  async appOption(app) {    const from = Math.floor(Date.now() / 1000) - (60 * 60 * 24); // 1 day ago    const moodRatings = await app.getMoodRatings(from);    await app.alert("Mood ratings: " + JSON.stringify(moodRatings));  }} 
  ```
processedNoteContent: ---
  title: App Interface: Plugin methods to interact with ...
  headers: ## app.getAttachmentURL
  ---
  app.getAttachmentURL
  Given the UUID of an attachment, returns a temporary URL that can be used to access the attachment. The client must be online for this function to succeed.
  Arguments
  String [attachment](/help/developing_amplenote_plugins/appendix_i#attachment)
    UUID identifying the attachment
  Returns
  String temporary URL that can be used to access the attachment content {  async noteOption(app, noteUUID) {    const attachments = await app.getNoteAttachments({ uuid: noteUUID });    if (attachments.length > 0) {      const attachmentURL = await app.getAttachmentURL(attachments[0].uuid);      await app.alert("URL: " + attachmentURL);    } else {      await app.alert("Note doesn't have any attachments");    }  }}
  
  Example: reading attachment content
  Note that the web environment plugin code executes in requires a server to respond with CORS headers, and the attachments server does not add these headers for the plugin code origin. The attachments server address is allowed through a plugin CORS proxy that adds the appropriate headers, so it can be used to fetch attachment data. {  async noteOption(app, noteUUID) {    const attachments = await app.getNoteAttachments({ uuid: noteUUID });    if (attachments.length === 0) {      await app.alert("Note doesn't have any attachments");      return;    }     const attachmentURL = await app.getAttachmentURL(attachments[0].uuid);     const proxyURL = new URL("https://plugins.amplenote.com/cors-proxy");    proxyURL.searchParams.set("apiurl", attachmentURL);     const response = await fetch(proxyURL);    const attachmentContent = await response.text();     await app.alert("Attachment text content: " + attachmentContent);  }}
  
  app.getCompletedTasks
  Gets tasks completed in the given time range, which includes standard completed, dismissed, and crossed-out tasks.
  Arguments
  integer unix timestamp, only tasks completed on or after this time will be returned
  integer unix timestamp, only tasks completed before this time (non-inclusive) will be returned
  Returns
  Array of [task](/help/developing_amplenote_plugins/appendix_i#task)
    objects describing the completed tasks {  async appOption(app) {    const to = Math.floor(Date.now() / 1000); // now    const from = to - (60 * 60 * 24); // 1 day ago     const completedTasks = await app.getCompletedTasks(from, to);    await app.alert("Completed task count: " + completedTasks.length);  }} 
  
  app.getMoodRatings
  Arguments
  integer unix timestamp, only ratings left on or after this time will be included in the results
  (optional) integer unix timestamp, only ratings left before this time will be included in the results
  Returns
  Array of [moodRating](/help/developing_amplenote_plugins/appendix_i#moodRating)
    objects {  async appOption(app) {    const from = Math.floor(Date.now() / 1000) - (60 * 60 * 24); // 1 day ago    const moodRatings = await app.getMoodRatings(from);    await app.alert("Mood ratings: " + JSON.stringify(moodRatings));  }}
noteTitle: App Interface: Plugin methods to interact with user notes