401, Unauthorized; scope does not match [solved]

Never mind, was using wrong API function.