Support

Expand all | Collapse all

API project creation (and documentation clarifications)

  • 1.  API project creation (and documentation clarifications)

    Posted 07-07-2020 12:57
    Hello,

    I am attempting to automate some processes that are a bit of a chore to do manually. One of these is project creation. I have seen the API documentation here https://rest.jamasoftware.com/ but unless I'm missing something I'm unsure how to proceed. My questions:

    - To make a project, I must make a POST call with the /projects endpoint. The documentation states that the JSON body of this call must be of type RequestProject. The example given does not appear to use that type, as it does not contain any of the fields located in the documentation for the type. Is this in error, or am I looking at the wrong example? Are there other examples I can look at to assist my work?
    - The RequestProject documentation mentions a "parent" field. Does this refer to a parent project in the organizational heirarchy/structure, or does this create a copy of the parent. If not a copy, is there a way to create a copy from an existing project?
    - The "fields" field of the RequestProject datatype specifies a few examples, but I cannot find a list of values and keys it accepts. Where can I find documentation on this? Am I overlooking a general set of values?

    Sorry for the multiple questions here, would love to take advantage of the API and I appreciate any help you can give me here.

    ------------------------------
    Taylor Kirkpatrick
    Thermo Fisher Scientific
    ------------------------------


  • 2.  RE: API project creation (and documentation clarifications)

    Posted 07-08-2020 08:16
    Edited by Chloe Elliott 07-08-2020 08:24
    Taylor:

    Looks like you are looking in all the right places. One thing that seems to help people as they learn the REST API is to cross reference or just use SwaggerSwagger UI is an interactive documentation tool used with REST API. This tool is available to users with a valid login and REST enabled. Swagger can be accessed through {Context-Path}/api-docs/.  You can just use Swagger to run your calls or many of our customers find Swagger useful in checking the functionality/schema/architecture of the call and then use that information to help craft their scripts.

    Here is a screenshot of the Project endpoint in Swagger (I expanded on the POST/projects endpoint):


    Another cool resource is the API Cookbook.

    Hope this helps,

    ------------------------------
    Chloe Elliott
    Jama Software
    Portland OR
    ------------------------------



  • 3.  RE: API project creation (and documentation clarifications)

    Posted 07-08-2020 14:36

    Thanks for the response Chloe.

    That does clear up my question about the docs discrepancy, it seems the examples listed on the main API doc are actually examples of a response to a valid query, not examples of the valid query itself.

    Swagger will help a lot if I need to find what fields are valid through trial and error, or at least as a starting point.



    ------------------------------
    Taylor Kirkpatrick
    Thermo Fisher Scientific
    ------------------------------



  • 4.  RE: API project creation (and documentation clarifications)

    Posted 07-08-2020 14:55
    Taylor:

    It is helpful, but beware, the calls you make ("try it out") do affect your actual project. GET calls are safe, but the POST, PUT and DELETE can be interesting.... Have fun! Having a Test project or even a whole Sandbox instance would be helpful here.

    Best,

    ------------------------------
    Chloe Elliott
    Jama Software
    Portland OR
    ------------------------------