Resource functions
- get_resource_field_data
- create_resource
- delete_resource
- copy_resource
- get_resource_log
- update_resource_type
- get_resource_path
- get_resource_data
- get_alternative_files
- get_resource_types
- add_alternative_file
- delete_alternative_file
- upload_file
- upload_file_by_url
- upload_multipart
- get_related_resources
- resource_log_last_rows
- replace_resource_file
- get_resource_all_image_sizes
- put_resource_data
- update_related_resource
- relate_all_resources
- get_edit_access
- get_resource_access
- resource_file_readonly
Collection functions
Search functions
IIIF
Metadata functions
User functions
System
Message functions
Plugin functions
create_resource
Create a new resource.
Variable | Description | Data type | Default value |
---|---|---|---|
$resource_type * | The ID of the resource type for the new resource (e.g. 1=Photo). | integer | |
$archive |
The archive/workflow state of the new resource. Pending submission: -2 |
integer | 999 |
$url | Optional The URL of a file to upload. ResourceSpace will copy the file to the local system then import it to the specified resource. System config. $api_upload_urls may need updating to allow upload from the supplied URL. |
string | "" |
$no_exif | Optional Do not process embedded metadata. Leave blank for the default (to process data). |
bit (0 or 1) | 0 |
$revert | Not currently used, leave blank. | bit (0 or 1) | 0 |
$autorotate | Optional Automatically rotate (correct) images if the rotation flag is set on the image. |
bit (0 or 1) | 0 |
$metadata | Optional The metadata to add. A JSON encoded array of field ID to value string pairs. See the example in api/example.php. |
string | "" |
Return values
The ID of the newly created resource.