Title
#help
o

Omkar Patil

10/03/2022, 12:23 PM
I am trying to insert object into LakeFS repo with java client. I am trying to insert object using postman!! I am facing one issue !! I am not able to understand what I need to insert into path and into physical address while sending in body. Any help would be appreciated Getting this response after hitting this API { "message": "parameter "path" in query has an error: value is required but missing: value is required but missing" }
Jonathan Rosenberg

Jonathan Rosenberg

10/03/2022, 12:44 PM
Hi @Omkar Patil This is the signature of the
uploadObjectCall
method of the
ObjectsApi
java class:
uploadObjectCall(String repository, String branch, String path, String storageClass, String ifNoneMatch, File content, final ApiCallback _callback)
The repository and branch parts are quite easy to understand.
path
is the namespace under your branch, meaning the if you have a repository called
myrepo
and a branch called
mybranch
then for
<lakefs://myrepo/mybranch/some/name/space>
the path is:
some/name/space
1:15 PM
can you share the Java code you’re trying to execute?
o

Omkar Patil

10/03/2022, 1:20 PM
I am trying through postman
Jonathan Rosenberg

Jonathan Rosenberg

10/03/2022, 1:27 PM
Using Postman will be much more complicated than using the Java client. You need to add the authentication headers and their values (after you generated them) and also use the user credentials. It would be easier to use the Java client that does that for you. Also, the image you sent is using the response format of that API call as the request…
o

Omkar Patil

10/03/2022, 1:28 PM
Yes I have added authentication headers
Yoni Augarten

Yoni Augarten

10/03/2022, 1:29 PM
@Omkar Patil, also note that the path parameter when uploading an object is to be given using a query parameter. The content of the request should be used for the file's actual content. See the API reference for how to upload an object.
o

Omkar Patil

10/03/2022, 1:30 PM
@Yoni Augarten I am following the same document but I am not able to figure exact value for path in body
Yoni Augarten

Yoni Augarten

10/03/2022, 1:30 PM
The path is where you want to upload the object to, in your repository.
1:31 PM
You can start by uploading a file from the UI, and inspecting the upload request in the network console. This will give you an idea of what happens under the hood.
o

Omkar Patil

10/03/2022, 1:44 PM
@Yoni Augarten I am checking in network tab!! I copied into postman the same payload but it is not working.. facing the same error
1:44 PM
If possible can we connect on huddle?
Yoni Augarten

Yoni Augarten

10/03/2022, 1:45 PM
Thanks for the information. In order for the community to benefit from our conversation in the future, let's keep this in the chat.
1:45 PM
Can you confirm that uploading a file has worked from the UI?
o

Omkar Patil

10/03/2022, 2:10 PM
This is the UI image and payload
Yoni Augarten

Yoni Augarten

10/03/2022, 2:14 PM
@Omkar Patil I'm taking a look. One second please
Oz Katz

Oz Katz

10/03/2022, 2:14 PM
@Omkar Patil from the looks of it , it seems like you're trying to pass the response parameters as the request.
2:16 PM
the POST body shouldn't be JSON, it should be
multipart/form-data
with a
content
field. See https://docs.lakefs.io/reference/api.html#/objects/uploadObject
o

Omkar Patil

10/03/2022, 2:52 PM
Thank you your help @Oz Katz!! I tried with adding header as Content-Type and value as Multipart/form-data but I am facing the error "message": "no multipart boundary param in Content-Type"
2:52 PM
Could you please give one example how we can pass request body?
Yoni Augarten

Yoni Augarten

10/03/2022, 2:55 PM
@Omkar Patil, as @Jonathan Rosenberg mentioned before - uploading an object via Postman requires some knowledge, in particular sending multipart requests. As suggested, using one of our clients (Java, Python, or the AWS CLI) can simplify things. If you are sure you want to use Postman, you can use this guide to see how you can copy a request from the web console to Postman.
3:02 PM
Update: I see this guide doesn't really work with multipart requests.