Post action api rest

I have pasted my sample python code here.