Hi folks, I'm using the ArcGIS REST API directly from a python script through the `requests` library.
I've developed the script to use the /generateToken call, and then include the token in the `token` parameter.
Using this approach, I'm able to submit CopyRaster jobs, which run sucessfully.
Recently, I tried to implement the suggested approach to tokens as described in HTTP header authentication documentation, where the token is part of the `X-Esri-Authorization` header.
The issue is that in this case, the CopyRaster jobs fails with the following message:
Messages: [{'type': 'esriJobMessageTypeInformative', 'description': 'Submitted.'}, {'type': 'esriJobMessageTypeInformative', 'description': 'Executing...'}, {'type': 'esriJobMessageTypeInformative', 'description': 'Start Time: Wednesday, July 26, 2023 11:11:26 PM'}, {'type': 'esriJobMessageTypeError', 'description': '{"messageCode": "RA_120305", "message": "Your need either hosted tiled imagery or hosted dynamic imagery privilege to create hosted imagery layer."}'}, {'type': 'esriJobMessageTypeError', 'description': '{"messageCode": "RA_120002", "message": "CopyRaster failed. Unexpected Error occured during service Execution. ."}'}, {'type': 'esriJobMessageTypeError', 'description': '{"messageCode": "RA_120306", "message": "Cause of failure: Unexpected Error occured during service Execution. .", "params": {"cause": "Cause of failure: Unexpected Error occured during service Execution. "}}'}, {'type': 'esriJobMessageTypeInformative', 'description': 'Failed script CopyRaster...'}, {'type': 'esriJobMessageTypeError', 'description': 'Failed to execute (CopyRaster).'}, {'type': 'esriJobMessageTypeInformative', 'description': 'Failed at Wednesday, July 26, 2023 11:11:37 PM (Elapsed Time: 10.11 seconds)'}, {'type': 'esriJobMessageTypeError', 'description': 'Failed.'}]
The only difference is the token being in the header or in the `token` parameter. Everything else is the same. Mind you, the job is submitted successfully.
What is the issue? It's the same token...
PS. There's a typo in the error message: Your need either hosted tiled imagery or hosted dynamic imagery privilege to create hosted imagery layer.