GS2017 Web API - Project setup - Upload files for project creating

Hi,

I'm trying to set up a project through the web api of GS2017. When calling "/api/projectserver/v2/projects", I get a GUID as response. I assume this is the id if the new project, though, I cannot see new projects in the Project list of GS at this point. (Is this normal?)

I try to upload a source package then using this id and make a post to "/api/projectserver/v2/projects/{projectId}/files/upload". The help says:

In order to upload the files, a POST request needs to be made to ...  including a zip file containing all the project files as multipart/form-data content.

=> what field name should I use for the file content ?

This is the multipart header I use:

string headerTemplate =
"Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\n" +
"Content-Type: application/octet-stream\r\n\r\n";

I tried with name=file, but I got an Internal Server Error (500) response. 

Content type is "multipart/form-data; boundary=----------------------------8d4930437814d23"

Can you please help what parameters I should use here? Is there maybe a working example code somewhere that I could use?

thanks,

Tamas

Parents
  • Hi Tamas,

    Unknown said:
    When calling "/api/projectserver/v2/projects", I get a GUID as response. I assume this is the id if the new project, though, I cannot see new projects in the Project list of GS at this point. (Is this normal?)

    Yes, this is the normal behavior, you'll receive an id, and that id will be used the upload files on the newly created project, after that the project will be available on projects list.

    Please make sure when you create a project request send organization id and project template id as parameters.

    In  the couple of days we'll release GroupShareKit library, it will be available on NuGet. This library facilitates the calls to GroupShare, but it requires .Net framework .

    Until then you can see an example on how to create a project here, look at the "Create project " method.  

    If you have any question don't hesitate to ask.

    Regards,

    Andrea.

Reply
  • Hi Tamas,

    Unknown said:
    When calling "/api/projectserver/v2/projects", I get a GUID as response. I assume this is the id if the new project, though, I cannot see new projects in the Project list of GS at this point. (Is this normal?)

    Yes, this is the normal behavior, you'll receive an id, and that id will be used the upload files on the newly created project, after that the project will be available on projects list.

    Please make sure when you create a project request send organization id and project template id as parameters.

    In  the couple of days we'll release GroupShareKit library, it will be available on NuGet. This library facilitates the calls to GroupShare, but it requires .Net framework .

    Until then you can see an example on how to create a project here, look at the "Create project " method.  

    If you have any question don't hesitate to ask.

    Regards,

    Andrea.

Children