Fetching a NONCE Token from a Service
This example shows you how to fetch a NONCE token from a service. Use the following GET request.
URI
GET Windchill/servlet/odata/PTC/GetCSRFToken() HTTP/1.1
The token is returned in the JSON response. For example, the response is as shown below:
{
"@odata.context": "https://windchill.ptc.com/Windchill/servlet/odata/v3/PTC/$metadata#CSRFToken",
"NonceKey": "CSRF_NONCE",
"NonceValue": "8q87WtSxvWkSH9FMtsQUboOI5TtCS7gWh8RUb4OG ="
}
The value of CSRF_NONCE returned from this request must be passed as request header in all the examples provided in this User’s Guide to create (POST requests), modify (PUT and PATCH requests), or delete (DELETE request) entities.
これは役に立ちましたか?