We consider initial boundary value problems for one-dimensional diffusion equation with time-fractional derivative of order (Formula presented.) which are subject to non-zero Neumann boundary conditions. We prove the uniqueness for an inverse coefficient problem of determining a spatially varying potential and the order of the time-fractional derivative by Dirichlet data at one end point of the spatial interval. The imposed Neumann conditions are required to be within the correct Sobolev space of order α. Our proof is based on a representation formula of solution to an initial boundary value problem with non-zero boundary data. Moreover, we apply such a formula and prove the uniqueness in the determination of boundary value at another end point by Cauchy data at one end point. © 2021 Informa UK Limited, trading as Taylor & Francis Group.