0

Get image URL via REST API?

Is there a way to get the full URL for an image field via the REST API so that I can load the image?

10 replies

null
    • Paul_Colton
    • 3 yrs ago
    • Reported - view

    I figured it out. The API docs in PDF form that I downloaded were outdated, the web site version talks about the .../files/filename request, which works.

     

    GET https://api.ninoxdb.de/v1/teams/:teamid/databases/:databaseid/tables/:tableid/records/:recordid/files/:filename

     

    https://ninox.com/en/manual/api/rest

    • Karen_Estrada
    • 3 yrs ago
    • Reported - view

    Hi Paul (or anyone else that can please help me :-> )

    I have been trying (struggling) to do the exact same re: question you posted and then figured out.

    Somehow I cannot figure this out and it's very frustrating at this point and it'll probably be something very obvious.

    I've waited to ask the question here because (a.) I wanted to figure it out myself and (b.) I didn't want to look stupid :-> 

    I've read thru the manual (Ninox) a million times, searched through the forum, anyway --  I do know how to do some of it (enter the code for the request as well as part of the URL I need to enter there for the GET request including tableID but then I hit a roadblock ... I don't understand 'the record', and the rest (files, filename...). I believe you put the formula/code in a button, correct? 

    And then, what is the "full URL", with regard to where you are supposed to be getting the images from? Were you attaching the image to an existing record? Did you create a new record as a result of your request? Or does the image already exist in one of your databases ... and that's what you are 'GETing'??

    If not, then for example, let's say you want to get an image from Dropbox or Google Drive ... in both cases the image does have a URL to "Get" (and I know you'd need the API keys to each of those sources to 'obtain' your image files or documents from there).

    In the case of Dropbox, the file URLs (whether images or documents) have a "?" in the link which the manual says the 'file name' cannot have. 

    I am totally stuck. Any help is appreciated ...  

    thanks!! 

    Karen <--"API Challenged"

    • Karen_Estrada
    • 3 yrs ago
    • Reported - view

    <sorry> ... I forgot to put -- == spaces in between paragraphs to make the post easier to read. Unfortunately we can't edit our posts once they're posted. ke

    • Karen_Estrada
    • 3 yrs ago
    • Reported - view

    Hi Dean, thanks! I had seen that post (and another similar one), ... and was able to do that :-)

    ==

    But what I want to be able to understand (and do) is the 'Get' Image URL via REST the question Paul originally asked and then said he had "figured it out". I've read the documentation (API) (over, and over again) but I'm just not 'getting' it. I'm not sure about the information needed for the URL, this part of it: ".... records/:recordid/files/:filename ) -- how to use it in a formula, how to make it work. ?? :-(

    ===

    Something else I had tried (unsuccessfully) based on the Dropbox example (the one you referred to) is how to use a link for a file/image from OneDrive (Microsoft) or other clouds: Google Drive, Mega Drive, or pCloud. All have 'share' links like Dropbox. 

    ==

    I just wish I could 'get' APIs and am frustrated that I can't even though I sure have worked on it (reading, trying/practice). 

    ===

    I really do appreciate your response and help ... I've learned a lot of things and/or have gotten much help/info from many other posts you provided answers for!

    Karen

    • Choices_Software_Dean
    • 3 yrs ago
    • Reported - view

    Are you trying to get an image from another Ninox database or from another service? Please explain your specific objective(s).

    • Karen_Estrada
    • 3 yrs ago
    • Reported - view

    It could be either, although I 'think' I can figure out how to get an image from another one of my Ninox databases, I just haven't tried that out yet. 

    -----

    What I really want to do is be able to do an API request to get images from another service. This is something I definitely haven't been able to figure out yet although it shouldn't be that 'difficult', I'm just not 'getting' it!  

    The end goal - to create a catalog (database) of graphics sets (which includes color palettes used to design them, any special effects (e.g. 3D or bevel, grandients (%), etc. 

    --- 

    CLOUD SERVICES (not all the images, collections exist on the computer hard drive). 

    Each one of those images has a URL. If they are 'public' (if I've activated 'Sharing'), I don't need to use an authentication key to Request them. In most cases they're not 'public so I do need to use the authentication key (which I have) in the Request.

    ----

    Regarding the Dropbox example, I was able to successfully use the script/code that was provided in the post(s) - there were two of them (posts). Although that isn't an API Request,  which is what I'm trying to figure out.

    --> In that case, when I substituted the Dropbox URL w/one from a different cloud service (i.e. OneDrive, Google Drive/Stream), I wasn't able to make that work. 

    Ultimately though, I want to use an API Request.  I know once I've done one and see the 'syntax' I'll be good to go. :-) 

    ---

    I really appreciate your help ... Karen

    • Paul_Colton
    • 3 yrs ago
    • Reported - view

    Karen,

    Hi there. It seems there's some confusion. The REST API here is for you to write code to get -to- your Ninox database data. That is, think custom code that connects to the Ninox servers and retrieves your data, images, etc. The API is not an -outbound- system for talking to other services. In that case, you would use that other service's APIs. Also, I don't even know if Ninox has any provisions for outbound connections to other services (other than URLs to resources).

    I'm writing a custom app that needs to retreive the data I've entered with Ninox. I needed access to my data as well as the images I had put into my database, hence my need for reach those via the API.

    Hope that helps.

    Paul

    • Choices_Software_Dean
    • 3 yrs ago
    • Reported - view

    Per Karen,

    "What I really want to do is be able to do an API request to get images from another service."

     "I know once I've done one and see the 'syntax' I'll be good to go."

     

    At:

    https://ninox.com/en/forum/technical-help-5ab8fe445fe2b42b7dd39ee7/how-to-lookup-vehicle-information-based-on-vehicle-id-number-5f32b0cae83baa02e3066b60

    you can see how Sean helped me to automatically retrieve vehicle information from the U.S. Department of Transportation website and place it into a Ninox table by simply typing a vehicle id number into a Ninox field. The two included links are good examples of instructions provided by their service that allows this to be done (free). As Paul said, you will need to follow the instructions of the service that you use. If you need to retrieve images from multiple services, the instructions for each may be different. Hope this helps.

    • Karen_Estrada
    • 3 yrs ago
    • Reported - view

    Paul and Dean --> Thank you ... thank you !!!!!!! You both have helped me A LOT! I am very grateful!! 

    == 

    Paul, Finally it sunk in, understood - Got it!!!   :-)) I'll have to practice writing some of those GET requests tomorrow. Is the GET Request (code) added to a button? (vs a formula field?) or can be on either?  

    ===

    Dean, thank you so much for your example and explanation + all your help. Now, it makes sense! 

    ===

    I can't wait until tomorrow morning to start working with all the info you've both been so kind to provide and help me out with! 

    Karen :-))

Content aside

  • 3 yrs agoLast active
  • 10Replies
  • 2651Views