Open Drive api - URI as input?

Discussion in 'AutoWeb' started by Lucas.bibby, May 6, 2017.

  1. Lucas.bibby

    Lucas.bibby New Member

    Joined:
    May 6, 2017
    Messages:
    8
    Likes Received:
    0
    Hi
    Still quite the noob.

    I am trying to use a device specific URI from internal MediaManager (provided by the Android system) as input for "file to upload". This manager returns device specific image URIs, example:
    But i think the % percent symbol breaks the autoweb action. Edit: maybe?? Now thinking maybe I can't use the URI like this?
    I get error:
    I have tried adding single quotes like so:
    That affected no change.

    I have tried adding a backslash like so:
    But that produces:
    I even tried parenthesis like so:
    But that produces:
    I am sure it is a simple fix but I am lost.
    Edit: now I'm not so sure how simple... URIs apparently don't work the way I thought they did...
    Still quite lost... Any help at all would be greatly appreciated.

    Thanks
     
    Last edited: May 7, 2017
  2. Lucas.bibby

    Lucas.bibby New Member

    Joined:
    May 6, 2017
    Messages:
    8
    Likes Received:
    0
    To be clear:

    I have a Google Sheet that is produced by another app over which I do not have control outside the provided UI. This sheet contains fields with device specific URIs from internal MediaManager (provided by the Android system). This manager returns device specific image URIs, like this:
    Which as far as I understand is a Uniform Resource Identifier and is a string of characters used to identify a resource. So in this case it references a specific image stored locally on my device.
    I have a list of these generated by another app and stored in a Google sheet.

    My goal is to use (leverage) these URIs to upload those specific images to Google drive, in a specified folder, share the images and return the new shareable download URLs.

    Ultimately I want to setup automation with workflow:1) to retrieve the spreadsheet, 2) copy the whole first worksheet to a second worksheet (so the app that generated it can still use it), 3) retrieve URI from the second sheet (get cell),
    ***I can already do all this so far***
    4)convert the URI to an acceptable input for drive api
    *** This is the part I cannot do, this is the basis of my question***
    ****The rest I can already do**"
    5) upload it, 6) share, 7) return URL, 8) replace URI on second sheet with new URL and 9) do the same for the next URIs in the next columns and rows (loop 3-9). 10) save and exit
    The end product will be a spreadsheet with two worksheets, one original from the app that generated it and sheet2 with usable/clickable URLs instead of unusable URIs.
    ******
    For now i think my first step is to figure out how to use the device specific URIs as input for the upload.
    ******
    I hope this is clear. And I hope someone can help.
    I am a big fan of the AutoApps Suite of tools and Tasker. I'm just really new to this.

    If it helps I am using an LGG3 D852 Android 6.0 MM with latest updates of Tasker and AutoApps Suite. All full versions. No root access.
    BUT... I am looking for a universal not device specific solution. Edit: that is to say the ideal solution should work across devices and (Android) platforms but the URIs would still be device specific.

    Thanks
     
    Last edited: May 7, 2017
  3. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    4,127
    Likes Received:
    389
    Can you please export your task's description (not xml) so I can take a look? Long-click the task in Tasker->export description Thanks in advance
     
  4. Lucas.bibby

    Lucas.bibby New Member

    Joined:
    May 6, 2017
    Messages:
    8
    Likes Received:
    0
    Tester (25)
    A1: Variable Set [ Name:%var2 To:content://com.android.providers.media.documents/document/image%3A19037 Recurse Variables:Off Do Maths:Off Append:Off ]
    A2: AutoWeb Web Service [ Configuration:API: Google Drive
    API Action: Files: insert
    File Name: thisfile.jpg
    File Description: na
    Starred: true
    Parent Id: root Timeout (Seconds):120 Continue Task After Error:On ]
    A3: Stop [ With Error:Off Task: ]
     
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    4,127
    Likes Received:
    389
    Ok, thanks :) If you use a normal file, does that work for you?
     
  6. Lucas.bibby

    Lucas.bibby New Member

    Joined:
    May 6, 2017
    Messages:
    8
    Likes Received:
    0
    Yes.
    Oddly though %Foto does not. That's why I suspected the percent symbol. But seems to call a variable fine, so......?
     
  7. Lucas.bibby

    Lucas.bibby New Member

    Joined:
    May 6, 2017
    Messages:
    8
    Likes Received:
    0
    Update:
    Tester (25)
    A1: AutoWeb Web Service [ Configuration:API: Google Drive
    API Action: Files: insert
    File: /storage/emulated/0/%FOTO
    File Name: 3thisfile.jpg
    File Description: na
    Starred: true
    Parent Id: root Timeout (Seconds):120 Continue Task After Error:On ]
    A2: Stop [ With Error:Off Task: ]
    A3: Variable Set [ Name:%var2 To:content://com.android.providers.media.documents/document/image%3A19037 Recurse Variables:Off Do Maths:Off Append:Off ]
    This one was a success!! %Foto now works (or... I know how to use it now) :D
     

Share This Page