View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Supportez nous sur Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Upload attachment file using API - ProjeQtOr

Prochaines Sessions

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)
 

2 décembre 2025 (16h-17h30)

 
 

Planifiez avec ProjeQtOr

10 et 11 décembre 2025 (9h-12h30)

 
 

Administrez avec ProjeQtOr

16 et 17 décembre 2025 (9h-12h30)

 

 

 

Upload attachment file using API

More
04 Déc 2025 15:59 - 04 Déc 2025 16:07 #1 by MagicBuzz
Hello,

I'm using the REST API to create tickets from a custom tool, and it works fine.

Now I want to add some files (logs, configuratuon files, etc.) to the created tickets.

I tried using this query :

{ "refType": "Ticket", "refId": "1234", "description": "Fichiers du mobile", "fileName": "bupreport.zip", "file": "{Convert.ToBase64String(zip)}" }

It creates an attachment, but I can't see the file, it looks like it wasn't uploaded.
I'm not sure how I should provide the file contents.
I tried encoding the file in base64 in a field "file" but it looks like to be ignored.

I tried as a multipart request too, but it fails.

var content = new MultipartFormDataContent();
content.Add(new StringContent("Ticket"), "refType");
content.Add(new StringContent(ticket.Id.ToString()), "refId");
content.Add(new StringContent("BugReport"), "description");
content.Add(new StringContent("bupreport.zip"), "fileName");
content.Add(byteArrayContent, "data", "bugreport.zip");


How can I do ?

If it's impossible, how can I upload an attachment using a regular HTTP POST request like the browser uses when we send a file from the HTML GUI?
Last edit: 04 Déc 2025 16:07 by MagicBuzz.

Please Connexion or Create an account to join the conversation.

More
12 Déc 2025 15:49 #2 by babynus
The API is not designed to upload files.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.032 seconds

Paramétrages de cookies

×

Cookies fonctionnels

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Veuillez vous connecter pour voir vos activités!

Autres cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.