Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Getting error message while creating tags via rest api using postman rest client. Apache atlas version is 0.7.

avatar
Explorer

POST : http://192.168.1.56:21000/api/atlas/types

Body : { "enumTypes": [], "structTypes": [], "traitTypes": [ { "superTypes": [], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "TagColumn_56_Api", "attributeDefinitions": [ { "testAttrKey": "TestAttrValue" } ] } ], "classTypes": [] }

Response: { "msgDesc": "Missing Required Header for CSRF Vulnerability Protection" } I am passing the credential from Authorization tab. what should I pass in the header? Please suggest the solution. Thanks in Advance.

1 ACCEPTED SOLUTION

avatar
Rising Star

@Sumit Chakraborty

When using postman you may have to add the below header for POST requests. GET requests work without this header.

X-XSRF-HEADER:valid

View solution in original post

4 REPLIES 4

avatar
Guru

@Sumit Chakraborty

This like some sort of issue with the REST client. Try the same thing using CURL as the rest client.

Copy and past: { "enumTypes": [], "structTypes": [], "traitTypes": [ { "superTypes": [], "hierarchicalMetaTypeName": "org.apache.atlas.typesystem.types.TraitType", "typeName": "TagColumn_56_Api", "attributeDefinitions": [ { "testAttrKey": "TestAttrValue" } ] } ], "classTypes": [] }

into a file called payload.json.

curl -u admin:admin -d @payload.json -H "Content-Type: application/json" -X POST http://192.168.1.56:21000/api/atlas/types

Let me know if that works.

avatar
Explorer

@Vadim Vaks Thanks for the reply. I added the "X-XSRF-HEADER:valid" header and it worked in postman. 🙂 But from other Rest Client say "Advanced Rest Client", it worked without this header. And with the CURL its working fine as you said.

avatar
Rising Star

@Sumit Chakraborty

When using postman you may have to add the below header for POST requests. GET requests work without this header.

X-XSRF-HEADER:valid

avatar
Explorer

@Chethana Krishnakumar

Thanks for the answer. I added the said header and it worked in postman. :) But from other Rest Client say "Advanced Rest Client", it worked without this header.