Welcome to the forum! Please read this topic to learn how to post code correctly and other useful info for new members.

Refer to the API for the answer to your question.