Class: DhanHQ::Resources::Profile

Inherits:
BaseAPI
  • Object
show all
Defined in:
lib/DhanHQ/resources/profile.rb

Overview

Provides access to the user profile endpoint.

The endpoint is a simple GET request to ‘/v2/profile` that returns account level metadata (token validity, active segments, etc.).

Constant Summary collapse

API_TYPE =

Profile metadata is served from the non-trading API tier.

:non_trading_api
HTTP_PATH =

Base path for profile lookups.

"/v2/profile"

Instance Attribute Summary

Attributes inherited from BaseAPI

#client

Instance Method Summary collapse

Methods inherited from BaseAPI

#delete, #get, #initialize, #post, #put

Methods included from AttributeHelper

#camelize_keys, #inspect, #normalize_keys, #snake_case, #titleize_keys

Methods included from APIHelper

#handle_response

Constructor Details

This class inherits a constructor from DhanHQ::BaseAPI

Instance Method Details

#fetchHash

Fetch the authenticated user’s profile information.

Returns:

  • (Hash)

    Parsed response from the profile endpoint.



20
21
22
# File 'lib/DhanHQ/resources/profile.rb', line 20

def fetch
  get("")
end