Module: BlommingApi

Defined in:
lib/blomming_api.rb,
lib/blomming_api/help.rb,
lib/blomming_api/config.rb,
lib/blomming_api/version.rb,
lib/blomming_api/buy_endpoints.rb,
lib/blomming_api/oauth_endpoint.rb,
lib/blomming_api/public_helpers.rb,
lib/blomming_api/sell_endpoints.rb,
lib/blomming_api/private_helpers.rb

Defined Under Namespace

Modules: BuyEndpoints, Config, OauthEndpoint, PrivateHelpers, PublicHelpers, SellEndpoints Classes: Client

Constant Summary collapse

AUTHORS =
["Giorgio Robino"]
EMAILS =
["[email protected]"]
SUMMARY =
%q{www.blomming.com social commerce API's wrapper}
DESCRIPTION =
SUMMARY
HOMEPAGE =
"https://github.com/solyaris/blomming_api"
VERSION =
"0.6.1"

Class Method Summary collapse

Class Method Details

.aboutObject



11
12
13
14
15
16
# File 'lib/blomming_api/help.rb', line 11

def BlommingApi::about
	"\tgem      : blomming_api (v.#{BlommingApi::VERSION})\n"\
  "\tsummary  : #{BlommingApi::SUMMARY}\n"\
  "\tauthors  : #{BlommingApi::AUTHORS.join(',')} (#{BlommingApi::EMAILS.join(',')})\n"\
  "\thomepage : #{BlommingApi::HOMEPAGE}\n"
end

.authentication_helpObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/blomming_api/help.rb', line 56

def BlommingApi::authentication_help
  <<-CONFIGURATION_HELP
Authentication set-up

In order to be granted to access to Blomming API, each client must be identified by some credential values (oauth server authentication). 

Get your Blomming API credentials
=================================

API credentials are generated by Blomming tech team for a per 3rd part application use. Please contact [[email protected]](mailto:[email protected]) and explain briefly why do you need them and how do you plan to use Blomming service. Blomming tech team will be happy to give you the full access to API!

Buy Services Authentication
---------------------------

To access Blomming APIs, each client must be identified by two credential values required as parameters of initial Blomming OAuth server bearer token request:

- *Application ID*
- *Secret*

Sell Services Authentication
----------------------------

Application ID and Secret values, are all you need to use buy services, but in case of sell services, you must authenticate supplying also your Blomming account cusername and password:

- *Username*
- *Password*


Set-up your *blommimg_api* configuration file 
=============================================

Using the blomming_api gem, a client must be "initialized" with a YAML configuration file (.yml), in order to store all Blomming API credentials data and some default API values, among others:

- *domain* (production/staging API urls) 
- *api_version* (API release number)


You have to set-up all data on a blommimg_api YAML configuration file `<your_config_file.yml>`, following these two possible skeletons:


Config file for *BUY services* authentication
---------------------------------------------

Config file example: `your/path/to/buy_services_stage_config.yml` :

  description: my account for buy services, access to staging server 

  services: buy

  client_id: __copy_here_your_blomming_api_client_id__
  client_secret: __copy_here_your_blomming_api_client_secret__

  domain: https://blomming-api-staging.herokuapp.com
  api_version: /v1

  default_currency: USD
  default_locale: US

  verbose: false


Config file for *SELL services* authentication
----------------------------------------------

Config file example `your/path/to/buy_services_prod_config.yml`:

  description: my account for sell services, access to production server  

  services: sell

  client_id: __copy_here_your_blomming_api_client_id__
  client_secret: __copy_here_your_blomming_api_client_secret__

  username: __copy_here_your_blomming_account_username__
  password: __copy_here_your_blomming_account_password__

  domain: https://api.blomming.com
  api_version: /v1

  default_currency: EUR
  default_locale: it

  verbose: true 

CONFIGURATION_HELP
end

.endpoints_helpObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/blomming_api/help.rb', line 18

def BlommingApi::endpoints_help
  puts "BUY ENDPOINTS METHODS"
  puts "=====================\n"

  buy_endpoints_methods = BlommingApi::BuyEndpoints.instance_methods(false)
  
  buy_endpoints_methods.each do |method_name|
    display_method_info method_name
  end 

  puts "SELL ENDPOINTS METHODS"
  puts "======================\n"

  sell_endpoints_methods = BlommingApi::SellEndpoints.instance_methods(false)
  
  sell_endpoints_methods.each do |method_name|
    display_method_info method_name
  end
end