-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setFiles #21
Comments
Hi @vgavrilovikj, You can see this in the dev-description for the notion-api: To be sure, I also searched a bit, and also found a small stackoverflow-thread, which describes the current state: Since the property can be retrieved in some way the property class Files::class exist, but cannot be set within the page with'setFiles'. 🎯 To avoid confusion, we'll plan to use a 'modifiable'-trade within property classes, to clarify, if a page property can be modified within page update and creation. This will be the case in version 0.5.0 or latest in 0.6.0 of laravel-notion-api. As soon as the notion api gets updated in some way, we'll make sure to include the feature asap. |
Hey, @johguentner thank you so much for getting back on such short notice! Cool, I wanted to use it so I can insert images (from URL) into Notion, but for the time being, I made it work by changing the Notion property to URL so I can insert the URL and when I need the image, I will just change the property type to File & media so I can view the image.. But totally as soon as Notion updates their API would be good to use the setFiles |
For sure @vgavrilovikj! Yeah, that seems like the best practice for now! Of course! We'll make sure to attach the linked pull-request to this issue and write a short notice, as soon as it's out ✨. |
Hi @vgavrilovikj, I implemented the following: # retreive page with property "Files" as files-property
$page = \Notion::pages()->find($pageId);
$page->set("Files", Files::value([$imgurl]));
$page = \Notion::pages()->update($page);
# the patched/posted data the laravel-notion-api is generating is the following:
array:1 [
"properties" => array:1 [
"Files" => array:1 [
"files" => array:1 [
0 => array:1 [
"name" => "<<the_inserted_url>>"
]
]
]
]
] The notion-api accepts the patch-request, however the files-property "Files" is not updated at all. We'll have an eye on the changelog of the notion-api (https://developers.notion.com/changelog) |
I can see in the Entities\Properties - Files is listed as property, however, setFiles() function is not present in the Page.php..
Is this something that can be added? Thank you :) @mechelon
The text was updated successfully, but these errors were encountered: