Skip to content

Latest commit

 

History

History
75 lines (65 loc) · 2.7 KB

V1_get_space_template.md

File metadata and controls

75 lines (65 loc) · 2.7 KB
copyright link is
Copyright IBM Corp. 2018
get-space-template
beta

Get Space Template

A user can fetch details of a space template by passing its id to the spaceTemplate query, provided the user either created the template or is subscribed to the offering with which the template is associated.

Schema

Fetch A Space Template

type QueryRoot {
  ...
  spaceTemplate(id: ID!): SpaceTemplate
}

Example request

Method: POST
URL: https://api.watsonwork.ibm.com/graphql
Headers: 'Content-Type: application/graphql' , 'x-graphql-view: PUBLIC, BETA'
Body:
{
  spaceTemplate(id: "template-id") {
    name
    requiredApps {
      items {
        id
      }
    }
    properties {
      items {
        id
        type
        displayName
        ... on SpaceListProperty {
          defaultValue
          acceptableValues {
            id
            displayName
          }
        }
        ... on SpaceTextProperty {
          defaultValue
        }
        ... on SpaceBooleanProperty {
          defaultStringValue
        }
      }
    }
    spaceStatus {
      defaultValue
      acceptableValues {
        id
        displayName
      }
    }
  }
}

Don’t forget to replace the "template-id" argument with the ID of a real template.

For more information see Space Templates