What response code should be passed to client in case of following scenarios?
I chose 403. I also found following that I feel can be used.
Wikipedia:
412 Precondition Failed : The server does not meet one of the preconditions that the requester put on the request
Suggest code if I should use other than 403.
400 is the best choice in both cases. If you want to further clarify the error you can either change the Reason Phrase or include a body to explain the error.
412 - Precondition failed is used for conditional requests when using last-modified date and ETags.
403 - Forbidden is used when the server wishes to prevent access to a resource.
The only other choice that is possible is 422 - Unprocessable entity.