How to pass attachment url in attachment creation API
I am trying to create atachments through API. I pass my file's s3 public url. But when I try to view the file I get the below error - {"statusCode":400,"message":"Folder https: is not allowed","error":"Bad Request"}
My API request -
curl https://api.twenty.com/rest/attachments \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"name": "test attachmnet through api 2",
"fullPath": "https://attachments-test-home.s3.ap-southeast-1.amazonaws.com/Twenty%20Hosted%20-%20%281%29.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-P",
"type": "",
"opportunityId": "a379099a-3013-42ee-b001-1581b14cbba1"
}'
I am not sure which url should I pass here. Any help is appreciated.
5 Replies
Hello @azmat
fullPath
should not be an url
"FOLDER/ID"
Regarding
@Prastoin So how does this work if I want the file in s3 and I want to create an attachment using the Create API for attachment. So does it mean I set the variables as shown in the screenshot and then I need to have a folder called "attachment" in the s3 bucket and save the file there and then make the api call that passes "attachment/file-name.png" in the
fullpath

@prastoin please help me understand the correct usage of this api.
Unless I'm mistaken if the folder does not exist it will get created when inserting in it
Storage configuration is defined in order to hit your aws instances
You need to upload the file then create the attachement
@prastoin thanks ..let me try