Patch Request REST API Time Entry Issue "Access to XMLHttpRequest has been blocked by CORS policy"
search cancel

Patch Request REST API Time Entry Issue "Access to XMLHttpRequest has been blocked by CORS policy"

book

Article ID: 238510

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

The company is using the call PATCH for time entries.  There is a CORS error:

Access to XMLHttpRequest at 'https://server/ppm/rest/v1/timesheets/15441873/timeEntries/43311448' from origin 'http://localhostxxxxx' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource

Resolution

  1. Review the origin mentioned in the error and address accordingly 
  2. Check CORS KB for full details on the commands : How to Set up CORS in Clarity

In this example particular example, the 'http://localhostxxxxx' should be removed by issuing the following commands:

  • admin system-options -delete CORS_ALLOW_ORIGIN
  • admin system-options -add CORS_ALLOW_ORIGIN '<https://server>'
  • service stop start app