Add an image to an API with Postman-Chrome - postman

I am working with a visual search service API. The engine should allow upload of images to the database and their identification when the same image is queried.
I am using the "PostMan" add-on to chrome for this purpose.
Example:
- The engine API Link: {API_URL}
- to add a new image should add: /refimages/
Now in the documentation it says we should somehow provide these information:
{
"refImgId":"img0093984",
"score":3.48
}
as JSON file and the
Image URL
I am not sure I know how I can provide these information to in Postman. I cannot find where the image URL can be provided. Do you have any ideas? Thanks for suggestions.
The file should be of format: multipart/form-data

If you look to the far right you can see "Text" change that to File, now you can choose a file to upload/post

Related

Postman: How to Export/Download API Documentation from Postman?

I have developed a collection in postman having a bunch of API Endpoints. I can add team member to my Postman workspace and also can share the Documentation link publicly online.
What I was finding to have a download link to download the documentation as a folder so that I could add them into my project.
Is there anything I failed to find in postman?
You can export the collection as a json as shown in the other answer and then run a tool to convert it into an HTML document that you can host wherever you want.
I created a simple python executable to do just that -
https://github.com/karthiks3000/postman-doc-gen
Hi #Siddiqui currently this feature is not available, I do it by going to my collection documentation and getting it to print when the print prompt is shown I save the document as PDF before finalizing the print options. Once I get it in PDF I have all sorts options to do as I want. This is the closest I have been to downloading my collection documentation.
I have redacted information for privacy.
Hope this helps or leave a comment if I can be of any further assistance.
Postman generated API documentation is meant to be shared and consumed via workspace and URL to help ensure it is kept up to date and does not go stagnant. Because documentation will most likely be regularly updated with examples, new endpoints, and other elements anything downloaded will quickly be out of date. I know that a PDF generated version has been discussed as part of future releases, but keeping API documentation up to date is the priority.
A simple solution to this is to print the page to PDF from the web browser. It's not perfect but it is usable.
https://learning.postman.com/docs/getting-started/importing-and-exporting-data/
to export the doc to json
and then run the script by #karthiks3000 (https://github.com/karthiks3000/postman-doc-gen)

How to updatde current URL while uploading document in SharePoint 2013 using CSOM

I am trying to change URL while uploading document to SharePoint document library using CSOM.
Description:
We have 'XYZ' document library with following folder structure:
Folder 1
SubFolder 1
- All Documents
Now I am trying to upload document at Folder 1. and after Drag and Drop document is getting uploaded to Folder 1. What I want to do here is, Whenever user try to upload document in Folder 1, it should get uploaded to SubFolder 1 . Is there any way to change URL of document in CSOM while its getting uploaded. So that it will get uploaded to 'SubFolder 1' even though user is doing DRagDrop to 'Folder 1'.
I am getting current folder URL in state.Status= Uploading event. I want to update this URL by adding 'Subfolder 1' to currentURL , so that it will upload this document direct to updated URL.
Note: If you have any other way to do it please let me know. also Cant go for Server side code. need CSOM.
Thank you in advance.
I have implemented similar requirements before and would recommend using a workflow for this. I have left out the step for getting the FormDigestValue by making a call to /_api/web/contextinfo, but that is needed in the request header.
The following URL format is used to call the API to move the document. Here is some documentation on the API.
/_api/web/getfilebyserverrelativeurl('/Folder1/file.pdf')/moveto(newurl='/Folder1/SubFolder1/file.pdf',flags=1)

Use Google Docs Viewer to open document from rails app (paperclup, cloudfiles)

In our rails app we use paperclip to save files to rackspace cloudfiles. We want to allow users to VIEW the files without needing to download them and use a program on their computer. We have found https://docs.google.com/viewer which looks good for the job
We have the following method in the controller:
def view
att = Attachment.find(params[:id])
redirect_to "http://docs.google.com/viewer?url=#{CGI.escape(att.file.expiring_url((Time.now + 60.seconds)).gsub(/^http:/, "https:"))}"
end
This generates the following url:
https://drive.google.com/viewerng/viewer?url=https://snet-storage101.syd2.clouddrive.com/v1/MossoCloudFS_4a360775-1b68-41f9-884f-e62e7567af25/container//attachments/files/000/003/488/original/AK-_Time_Recording.pdf?temp_url_sig%3Dd36797290b85f2dcd752xxxxxxe6a08951ad%26temp_url_expires%3D14xxxxx7408&u=0
The google docs viewer then tells us:
Apologies, there is no preview available.
I suspect it has to do with the "temp_url_sig" and "temp_url_expires" parameters that are appended to the pdf file url.
Any ideas how we can get this to work?

python upload image from a url to google drive api

For my Python app,I had completed the basic settings to interact with google drive api and found it working by a test upload of a CSV file. Now I need to upload an image from a url to a newly created folder named 'myappname' in Google Drive.
Thanks in advance
For now, there is no way you can directly upload file from url. There are two workaround I can think of
Download file and upload it back using Files.insert()
Use Save to Drive button
Using save to Drive button requires user interaction to click the button which might not be the one you want. In that case, downloading and uploading is the only way I can think of.

Django Admin doesn't recognize files uploaded on Google App Engine

I am using Django 1.4 on Google App Engine.
I have a model called Media, where the admins can upload files to use in their website. It has a field:
file = models.FileField(upload_to='/uploads/%Y/%m/%d')
It works perfectly with images (although the URL provided is weird), but that is not a problem.
The problem is when they try to upload a PDF (or anything else). Everything seems to work, but when you go to edit it, it doesn't contain any file - there is no "Currently" or anything else.
If I go to Google App Engine dashboard, the file is in Blob Viewer, and the record is also saved and available through the Datastore Viewer, with the correct blob key.
Why Django is not recognizing it? And how I can fix it?
djangoappengine contains a storage provider for the blobstore.
To me it doesn't seem like a full-featured solution, just something to get file uploads running.
I had to add this to get some functionality I needed (urls to the files).
It might make the admin work too:
https://github.com/dragonx/djangoappengine/commit/6a472a80c25bc077816c9104b45d5a64f3063273