class Paycargo::UsersResource
Public Instance Methods
login(**attributes)
click to toggle source
This endpoint allows you to send user credentials, if login success you receive a JWT token as a response for sending future requests to this API. Token validity time is 8 hours.
# File lib/paycargo/resources/users.rb, line 6 def login(**attributes) User.new post_request("login", body: attributes).body end
permissions(id, **params)
click to toggle source
This GET endpoint allows you to retrieve a list of permissions for the selected user. Endpoint requires to pass a valid user id parameter.
# File lib/paycargo/resources/users.rb, line 19 def permissions(id, **params) get_request("user/#{id}/permissions", params: params).body end
retreive(**params)
click to toggle source
This GET endpoint allows you to retrieve user information. You need to pass a valid user id so as JWT token. Only users of your account (or your branches if you are a headquarter) are retrievable.
# File lib/paycargo/resources/users.rb, line 13 def retreive(**params) User.new get_request("user", params: params).body end