hashschemarallywsapi

How do I use a hash to fetch the schema consistently?


The Agile Central (Rally) WSAPI documentation schema section says I can get the schema like this:

There is an optional hash for the schema request. If it is not provided, the service will determine the hash and redirect the request internally. Requesting a hash that is no longer current will redirect to the current hash. Schema request by project (service figures out the workspace): rally1.rallydev.com/slm/schema/v2.0/project/[ObjectID]/[Hash]

I need a consistent way to fetch the schema without redirection. I don't know what to enter for [Hash] in order to make a reliable schema end-point. I've noticed the auto-generated value of [Hash] expires at some interval.

How do I append a hash to get a consistent schema? There are no examples in the documentation, so what does the hash look like? Something like this?

rally1.rallydev.com/slm/schema/v2.0/project/12345/{"showMeTheModels": true}

or like this?

rally1.rallydev.com/slm/schema/v2.0/project/12345/99999999

Where 12345 is my Project ID and 99999999 is an arbitrary number I chose / generated by myself.

Thanks in advance!


Solution

  • That hash value is available via the SchemaVersion attribute on either the Project or Workspace you are scoping the schema to. If you're writing an app the App SDK already does this for you as part of building models with the ModelFactory.

    Otherwise the general process is:

    1) Do a read on /project/12345?fetch=SchemaVersion
    2) Do a read on /schema/v2.0/project/12345/[schemaversionfromstep1]