Hi,
I am using Box api with JWT, I am successfully able to connect and authenticate with the access token and can read the file, however when i am trying to upload file it keep on throwing the 404 not found error.
I am using Guzzlehttp library and Firebase, the documentation in box is limited so I am not sure what exactly wrong with the code.
Here is the code that I am using:
$response = $client->request('POST', 'https://api.box.com/2.0/files/content', [
'headers' => [
'Authorization' => "Bearer {$access_token}",
'As-User'=>"77390W773",
'Accept' => "multipart/form-data",
],
'multipart' =>
[
[
'name' => "attributes",
'contents'=>json_encode(['name'=>"test.txt",'parent'=>['id'=>"71425210032"]])
],
[
'name' => "file",
'contents' => fopen("/home/vser/public_html/ss/box/test.txt", 'r'),
],
]
])->getBody()->getContents();
I just trying to make a test upload on the folder, I went through the document which is mentioned here:
https://developer.box.com/reference#upload-a-file
Let me know if anything wrong that i am doing here.
Thanks