Downloading your project’s ingredients source code

To download a current list of the ingredients of your project you must:

  1. Download and install the State Tool.
  2. Authenticate your account using the state auth command.
  3. Generate a JSON web token for your project by using the state export jwt command.
  4. Use the GraphQL interface to send a query.
  5. Use the query output to download your project’s ingredient source code into your working directory.

Using graphQL

Example query:

{
  project(org: "ActiveState", name: "ActivePython-3.8") {
    __typename
    ... on Project {
      name
      description
      commit {
        commit_id
        sources(limit: 500) {
          name
          url
        }
      }
    }
    ... on NotFound {
      message
    }
    }
}

After running this query, replacing the project name and org in the example with the information from your project, you will get an output on the right-hand side of the screen similar to what’s shown below.

alt_text

If you are calling the API directly via cURL or a script, the endpoint is https://platform.activestate.com/sv/mediator/api. For more information about GraphQL check here.



Downloading the ingredient list

To download any of the tar/zip files from the GraphQL output you can run the following command:

curl -v -L -O --header "Authorization: Bearer <JWT_TOKEN>" <FILE_URL>

Replace the <JWT TOKEN> with the JSON web token generated in step 3. Use the URL of the tar/zip file in the GraphQL output as the <FILE_URL> in the above curl command. This will download the requested file to your current working directory.