cancel
Showing results for 
Search instead for 
Did you mean: 

Cloud TMS_v2 file upload API error

svedula
Explorer
0 Kudos

I am trying to implement the TMS_v2 REST APIs and I am stuck at uploading files using the endpoint /v2/files/upload.

Here is what I have done so far without any success.

  • I created a Cloud Transport Management instance and created a service key for the same.
  • I used the service key to generate an access token. The OAuth2 access token is generated with the following scopes - {"scope":"alm-ts-backend!b1896.display alm-ts-backend!b1896.import alm-ts-backend!b1896.transport_admin uaa.resource"}
  • I could not find where we can define the scopes for a token
  • I was able to query the REST endpoints /v2/destinations, /v2/nodes etc. using GET and I see the JSON response.
  • I tried using the same OAuth2 access token to upload a file to the endpoint /v2/files/upload using POST but I get the following error - {"message":"Access is denied","errorType":"org.springframework.security.access.AccessDeniedException"}
  • I tried uploading the file using Postman, API try out at https://api.sap.com/api/TMS_v2/tryout and even with Java Spring REST template and I get the same error.

I am not sure if I am missing any configuration part for the POST calls to work?

Any help will be much appreciated.

Thanks,

Srinath.

Accepted Solutions (1)

Accepted Solutions (1)

svedula
Explorer

I was able to solve the issue by creating a new CTMS instance with standard (having programatic access) plan. Previously I was using an instance with transport_operator plan and it did not have the required permissions to create a file.

Ref: Step 8 from https://help.sap.com/docs/TRANSPORT_MANAGEMENT_SERVICE/7f7160ec0d8546c6b3eab72fb5ad6fd8/13894bed9e2d...

regards,

Srinath.

Answers (0)