0

Uploading image via API http://drupal.local/entity/file?_format=hal_json API responding error Access denied on creating field 'status' when adding status field. I am using that API with credential of Administrator which have full rights.

{
    "_links": {
        "type": {
            "href": "http://drupal.local/rest/type/file/image"
        }
    },
    "filename": [
        {
            "value": "image-test.jpg"
        }
    ],
    "status": [
        {
            "value": "1"
        }
    ],
    "filemime": [
        {
            "value": "image/jpeg"
        }
    ],
    "type": [
        {
            "value": "file:image",
            "target_id": "image"
        }
    ],
    "filesize": [
        {
            "value": "3190"
        }
    ],
    "data": [
        {
            "value": "/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAEAAAAAAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAwADIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZa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jVPiR4i8ZRTai6iDVPCxWC18PwhEUbbGQ/vnMafODIh+6QTtGO1/Zx/ae+NXwt8bXzaTbab41mvoUnmkfSJpLjVYrSWK5lX7VatHM7C3kErQzvIHQBWTBw+XEjzKlQeIn/LC91yX5FC923fq+zXKpaq7Xd9TrUabaUea/W6t0drW3vrdq1lpbUq6b8AfiRpWnW9rafCvSdQtbaNYobq0tNLure5RQAskczZaRGABDkksCCSc0V9geFPDniHxh4X03Vhd/BRhqlrFdg6z4Z0m51I+Ygf/AEmX7H+8n5+d/wCJtx70V7NPiDFQioTqTi1o1bEaPtph2tNtzm+tXd3b/wAC/wCCf//Z"
        }
    ]
}

Without status field API uploads successfully with other mime type:application/octet-stream which should be image/jpeg.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.