Unfortunately, there is no official released REST API to get code diff of a given commit yet. You could submit a User Voice.
Currently, you would use that unofficial API in the link, or try git-diff command to show changes between commits, commit and working tree, etc.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…