Difference between revisions of "MOR API user register"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 22: Line 22:
** first_name - New user first name. '''Required'''.
** first_name - New user first name. '''Required'''.
** last_name - New user last name. '''Required'''.
** last_name - New user last name. '''Required'''.
** country_id - New user country. '''Required'''.
** country_id - New user country (please check table below). '''Required'''.
** email - New user email. '''Required'''.
** email - New user email. '''Required'''.
** device_type - Device type [SIP, IAX2]. '''Required'''.
** device_type - Device type [SIP, IAX2]. '''Required'''.
Line 67: Line 67:
*** <error>User with phone already exists</error> - Change phone.
*** <error>User with phone already exists</error> - Change phone.
*** <error>User with fax already exists</error> - Change fax.
*** <error>User with fax already exists</error> - Change fax.
<br><br>
=== List of Country IDs ===
1 - Afghanistan
2 - Albania
3 - Algeria
4 - American Samoa
5 - Andorra
6 - Angola
7 - Anguilla
8 - Antarctica
9 - Antigua And Barbuda
10 - Argentina
11 - Armenia
12 - Aruba
13 - Australia
14 - Austria
15 - Azerbaijan
16 - Bahamas
17 - Bahrain
18 - Bangladesh
19 - Barbados
20 - Belarus
21 - Belgium
22 - Belize
23 - Benin
24 - Bermuda
25 - Bhutan
26 - Bolivia
27 - Bosnia And Herzegovina
28 - Botswana
30 - Brazil
32 - Brunei Darussalam
33 - Bulgaria
34 - Burkina Faso
35 - Burundi
36 - Cambodia
37 - Cameroon
38 - Canada
39 - Cape Verde
40 - Cayman Islands
41 - Central African Republic
42 - Chad
43 - Chile
44 - China
45 - Christmas Island
46 - Cocos (Keeling) Islands
47 - Colombia
48 - Comoros
49 - Congo
50 - Congo, The Democratic Republic Of The
51 - Cook Islands
52 - Costa Rica
53 - Ivory Cost
54 - Croatia
55 - Cuba
56 - Cyprus
57 - Czech Republic
58 - Denmark
59 - Djibouti
60 - Dominica
61 - Dominican Republic
62 - Ecuador
63 - Egypt
64 - El Salvador
65 - Equatorial Guinea
66 - Eritrea
67 - Estonia
68 - Ethiopia
69 - Falkland Islands (Malvinas)
70 - Faroe Islands
71 - Fiji
72 - Finland
73 - France
74 - French Guiana
75 - French Polynesia
77 - Gabon
78 - Gambia
79 - Georgia
80 - Germany
81 - Ghana
82 - Gibraltar
83 - Greece
84 - Greenland
85 - Grenada
86 - Guadeloupe
87 - Guam
88 - Guatemala
89 - Guinea
90 - Guinea-Bissau
91 - Guyana
92 - Haiti
94 - Vatican City
95 - Honduras
96 - Hong Kong
97 - Hungary
98 - Iceland
99 - India
100 - Indonesia
101 - Iran
102 - Iraq
103 - Ireland
104 - Israel
105 - Italy
106 - Jamaica
107 - Japan
108 - Jordan
109 - Kazakhstan
110 - Kenya
111 - Kiribati
112 - Korea, Democratic People's Republic Of
113 - Korea, Republic of
114 - Kuwait
115 - Kyrgyzstan
116 - Laos
117 - Latvia
118 - Lebanon
119 - Lesotho
120 - Liberia
121 - Libyan Arab Jamahiriya
122 - Liechtenstein
123 - Lithuania
124 - Luxembourg
125 - Macao
126 - Macedonia
127 - Madagascar
128 - Malawi
129 - Malaysia
130 - Maldives
131 - Mali
132 - Malta
133 - Marshall islands
134 - Martinique
135 - Mauritania
136 - Mauritius
137 - Mayotte
138 - Mexico
139 - Micronesia
140 - Moldova
141 - Monaco
142 - Mongolia
143 - Montserrat
144 - Morocco
145 - Mozambique
146 - Myanmar
147 - Namibia
148 - Nauru
149 - Nepal
150 - Netherlands
151 - Netherlands Antilles
152 - New Caledonia
153 - New Zealand
154 - Nicaragua
155 - Niger
156 - Nigeria
157 - Niue
158 - Norfolk Island
159 - Northern Mariana Islands
160 - Norway
161 - Oman
162 - Pakistan
163 - Palau
164 - Palestine
165 - Panama
166 - Papua New Guinea
167 - Paraguay
168 - Peru
169 - Philippines
171 - Poland
172 - Portugal
173 - Puerto Rico
174 - Qatar
175 - Reunion
176 - Romania
177 - Russian Federation
178 - Rwanda
179 - Saint Helena
180 - Saint Kitts And Nevis
181 - Saint Lucia
182 - Saint Pierre And Miquelon
183 - Saint Vincent And The Grenadines
184 - Samoa
185 - San Marino
186 - Sao Tome And Principe
187 - Saudi Arabia
188 - Senegal
189 - Seychelles
190 - Sierra Leone
191 - Singapore
192 - Slovakia
193 - Slovenia
194 - Solomon Islands
195 - Somalia
196 - South Africa
198 - Spain
199 - Sri Lanka
200 - Sudan
201 - Suriname
203 - Swaziland
204 - Sweden
205 - Switzerland
206 - Syrian Arab Republic
207 - Taiwan
208 - Tajikistan
209 - Tanzania
210 - Thailand
212 - Togo
213 - Tokelau
214 - Tonga
215 - Trinidad And Tobago
216 - Tunisia
217 - Turkey
218 - Turkmenistan
219 - Turks And Caicos Islands
220 - Tuvalu
221 - Uganda
222 - Ukraine
223 - United Arab Emirates
224 - United Kingdom
225 - United States
227 - Uruguay
228 - Uzbekistan
229 - Vanuatu
230 - Venezuela
231 - Vietnam
232 - Virgin Islands, British
233 - Virgin Islands, U.S.
234 - Wallis And Futuna
236 - Yemen
238 - Zambia
239 - Zimbabwe
240 - Ascension Island
241 - Diego Garcia
242 - Inmarsat
243 - East Timor
246 - Iridium
247 - Serbia and Montenegro
250 - Emsat
251 - Ellipso-3
252 - Globalstar
253 - Montenegro
254 - Kosovo

Revision as of 11:15, 7 June 2012

This functionality is available from MOR 10


MOR API

Create new user from params.






  • Call: /api/user_register
  • Methods: POST, GET(if allowed, not recomended)
  • Params:
    • id - User UNIQUEHASH in MOR database. Required. If uniquehash is not used, user will end up at admin account.

Uniquehash can be found after loggin out of MOR in the address field of the browser, for example:

http://SERVERIP/billing/callc/login/kljsdfg54kl where kljsdfg54kl is the uniquehash.
    • username - New user username. Required.
    • password - New user password. Required.
    • password2 - New user password confirmation. Required.
    • first_name - New user first name. Required.
    • last_name - New user last name. Required.
    • country_id - New user country (please check table below). Required.
    • email - New user email. Required.
    • device_type - Device type [SIP, IAX2]. Required.
    • mob_phone - Mobile phone number.
    • phone - Phone number.
    • fax - Fax.
    • client_id - Company/Personal ID.
    • vat_number - TAX Registration Number.
    • state
    • county
    • city
    • postcode - Postcode/ZIP.
    • address
  • Returns:
    • Success
      • <status>Registration successful</status>
      • user_device_settings
        • <email>Registration email</email> - If email sending enabled.
        • <device_type>device type</device_type> - [SIP|IAX2]
        • <username>device username</username>
        • <password>device password</password>
        • <pin>device pin</pin>
        • <server_ip>Asterisk Server IP</server_ip>
        • <registration_notice>Registration_notice</registration_notice> - Registration_notice set in Settings
    • Errors:
      • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
      • <error>Registration over API is disabled</error> - Setting: Settings->API->API allow Registration, is off. Turn on API allow Registration.
      • <error>Dont be so smart</error> - User with UNIQUEHASH not found or params id not send. Enter correct id.
      • <error>Please enter username</error> - Params username is not send. Enter correct username.
      • <error>Enter device type</error> - device_type is not send. Enter correct device_type.
      • <error>Such username is already taken</error> - Duplicate of username. Change username.
      • <error>Passwords do not match</error> - Enter correct passwords.
      • <error>Password is too shorth</error> - Enter correct password.
      • <error>Please enter first name</error> - Enter first_name.
      • <error>Please enter last name</error> - Enter last_name.
      • <error>Please select country</error> - Enter country_id.
      • <error>Please enter email</error> - Email address is not valid or not send. Enter correct email.
      • <error>This email address is already in use</error> - Change email address.
      • <error>User with mobile phone already exists</error> - Change mobile phone.
      • <error>User with phone already exists</error> - Change phone.
      • <error>User with fax already exists</error> - Change fax.



List of Country IDs

1 - Afghanistan

2 - Albania

3 - Algeria

4 - American Samoa

5 - Andorra

6 - Angola

7 - Anguilla

8 - Antarctica

9 - Antigua And Barbuda

10 - Argentina

11 - Armenia

12 - Aruba

13 - Australia

14 - Austria

15 - Azerbaijan

16 - Bahamas

17 - Bahrain

18 - Bangladesh

19 - Barbados

20 - Belarus

21 - Belgium

22 - Belize

23 - Benin

24 - Bermuda

25 - Bhutan

26 - Bolivia

27 - Bosnia And Herzegovina

28 - Botswana

30 - Brazil

32 - Brunei Darussalam

33 - Bulgaria

34 - Burkina Faso

35 - Burundi

36 - Cambodia

37 - Cameroon

38 - Canada

39 - Cape Verde

40 - Cayman Islands

41 - Central African Republic

42 - Chad

43 - Chile

44 - China

45 - Christmas Island

46 - Cocos (Keeling) Islands

47 - Colombia

48 - Comoros

49 - Congo

50 - Congo, The Democratic Republic Of The

51 - Cook Islands

52 - Costa Rica

53 - Ivory Cost

54 - Croatia

55 - Cuba

56 - Cyprus

57 - Czech Republic

58 - Denmark

59 - Djibouti

60 - Dominica

61 - Dominican Republic

62 - Ecuador

63 - Egypt

64 - El Salvador

65 - Equatorial Guinea

66 - Eritrea

67 - Estonia

68 - Ethiopia

69 - Falkland Islands (Malvinas)

70 - Faroe Islands

71 - Fiji

72 - Finland

73 - France

74 - French Guiana

75 - French Polynesia

77 - Gabon

78 - Gambia

79 - Georgia

80 - Germany

81 - Ghana

82 - Gibraltar

83 - Greece

84 - Greenland

85 - Grenada

86 - Guadeloupe

87 - Guam

88 - Guatemala

89 - Guinea

90 - Guinea-Bissau

91 - Guyana

92 - Haiti

94 - Vatican City

95 - Honduras

96 - Hong Kong

97 - Hungary

98 - Iceland

99 - India

100 - Indonesia

101 - Iran

102 - Iraq

103 - Ireland

104 - Israel

105 - Italy

106 - Jamaica

107 - Japan

108 - Jordan

109 - Kazakhstan

110 - Kenya

111 - Kiribati

112 - Korea, Democratic People's Republic Of

113 - Korea, Republic of

114 - Kuwait

115 - Kyrgyzstan

116 - Laos

117 - Latvia

118 - Lebanon

119 - Lesotho

120 - Liberia

121 - Libyan Arab Jamahiriya

122 - Liechtenstein

123 - Lithuania

124 - Luxembourg

125 - Macao

126 - Macedonia

127 - Madagascar

128 - Malawi

129 - Malaysia

130 - Maldives

131 - Mali

132 - Malta

133 - Marshall islands

134 - Martinique

135 - Mauritania

136 - Mauritius

137 - Mayotte

138 - Mexico

139 - Micronesia

140 - Moldova

141 - Monaco

142 - Mongolia

143 - Montserrat

144 - Morocco

145 - Mozambique

146 - Myanmar

147 - Namibia

148 - Nauru

149 - Nepal

150 - Netherlands

151 - Netherlands Antilles

152 - New Caledonia

153 - New Zealand

154 - Nicaragua

155 - Niger

156 - Nigeria

157 - Niue

158 - Norfolk Island

159 - Northern Mariana Islands

160 - Norway

161 - Oman

162 - Pakistan

163 - Palau

164 - Palestine

165 - Panama

166 - Papua New Guinea

167 - Paraguay

168 - Peru

169 - Philippines

171 - Poland

172 - Portugal

173 - Puerto Rico

174 - Qatar

175 - Reunion

176 - Romania

177 - Russian Federation

178 - Rwanda

179 - Saint Helena

180 - Saint Kitts And Nevis

181 - Saint Lucia

182 - Saint Pierre And Miquelon

183 - Saint Vincent And The Grenadines

184 - Samoa

185 - San Marino

186 - Sao Tome And Principe

187 - Saudi Arabia

188 - Senegal

189 - Seychelles

190 - Sierra Leone

191 - Singapore

192 - Slovakia

193 - Slovenia

194 - Solomon Islands

195 - Somalia

196 - South Africa

198 - Spain

199 - Sri Lanka

200 - Sudan

201 - Suriname

203 - Swaziland

204 - Sweden

205 - Switzerland

206 - Syrian Arab Republic

207 - Taiwan

208 - Tajikistan

209 - Tanzania

210 - Thailand

212 - Togo

213 - Tokelau

214 - Tonga

215 - Trinidad And Tobago

216 - Tunisia

217 - Turkey

218 - Turkmenistan

219 - Turks And Caicos Islands

220 - Tuvalu

221 - Uganda

222 - Ukraine

223 - United Arab Emirates

224 - United Kingdom

225 - United States

227 - Uruguay

228 - Uzbekistan

229 - Vanuatu

230 - Venezuela

231 - Vietnam

232 - Virgin Islands, British

233 - Virgin Islands, U.S.

234 - Wallis And Futuna

236 - Yemen

238 - Zambia

239 - Zimbabwe

240 - Ascension Island

241 - Diego Garcia

242 - Inmarsat

243 - East Timor

246 - Iridium

247 - Serbia and Montenegro

250 - Emsat

251 - Ellipso-3

252 - Globalstar

253 - Montenegro

254 - Kosovo