Added config option for REST api base path on server and on site client. Currently on both "/api/v1" is used.
This commit is contained in:
parent
0a38481287
commit
59c4f77e3e
108 changed files with 390 additions and 374 deletions
1
app/assets/javascripts/app/config.js.coffee
Normal file
1
app/assets/javascripts/app/config.js.coffee
Normal file
|
@ -0,0 +1 @@
|
||||||
|
App.Config.set('api_path', 'api/v1')
|
|
@ -375,7 +375,7 @@ class App.Controller extends Spine.Controller
|
||||||
tickets = {}
|
tickets = {}
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/ticket_customer',
|
url: @Config.get('api_path') + '/ticket_customer',
|
||||||
data: {
|
data: {
|
||||||
customer_id: data.user_id,
|
customer_id: data.user_id,
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,7 +358,7 @@ class App.ControllerForm extends App.Controller
|
||||||
u = =>
|
u = =>
|
||||||
@el.find('#' + fileUploaderId ).fineUploader(
|
@el.find('#' + fileUploaderId ).fineUploader(
|
||||||
request:
|
request:
|
||||||
endpoint: 'api/ticket_attachment_new'
|
endpoint: App.Config.get('api_path') + '/ticket_attachment_new'
|
||||||
params:
|
params:
|
||||||
form_id: @form_id
|
form_id: @form_id
|
||||||
text:
|
text:
|
||||||
|
|
|
@ -23,7 +23,7 @@ class App.DashboardActivityStream extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'dashoard_activity_stream'
|
id: 'dashoard_activity_stream'
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/activity_stream'
|
url: @Config.get('api_path') + '/activity_stream'
|
||||||
data: {
|
data: {
|
||||||
limit: 8
|
limit: 8
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ class App.DashboardRecentViewed extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'dashboard_recent_viewed',
|
id: 'dashboard_recent_viewed',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/recent_viewed',
|
url: @Config.get('api_path') + '/recent_viewed',
|
||||||
data: {
|
data: {
|
||||||
limit: 5,
|
limit: 5,
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ class App.DashboardRss extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'dashboard_rss'
|
id: 'dashboard_rss'
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/rss_fetch'
|
url: @Config.get('api_path') + '/rss_fetch'
|
||||||
data: {
|
data: {
|
||||||
limit: 8
|
limit: 8
|
||||||
url: 'http://www.heise.de/newsticker/heise-atom.xml'
|
url: 'http://www.heise.de/newsticker/heise-atom.xml'
|
||||||
|
|
|
@ -30,7 +30,7 @@ class App.DashboardTicket extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'dashboard_ticket_' + @key,
|
id: 'dashboard_ticket_' + @key,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/ticket_overviews',
|
url: @Config.get('api_path') + '/ticket_overviews',
|
||||||
data: {
|
data: {
|
||||||
view: @view,
|
view: @view,
|
||||||
view_mode: 'd',
|
view_mode: 'd',
|
||||||
|
|
|
@ -37,7 +37,7 @@ class App.ProfileLanguage extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'preferences'
|
id: 'preferences'
|
||||||
type: 'PUT'
|
type: 'PUT'
|
||||||
url: 'api/users/preferences'
|
url: @Config.get('api_path') + '/users/preferences'
|
||||||
data: JSON.stringify(params)
|
data: JSON.stringify(params)
|
||||||
processData: true
|
processData: true
|
||||||
success: @success
|
success: @success
|
||||||
|
|
|
@ -53,7 +53,7 @@ class App.ProfileLinkedAccounts extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'account'
|
id: 'account'
|
||||||
type: 'DELETE'
|
type: 'DELETE'
|
||||||
url: 'api/users/account'
|
url: @Config.get('api_path') + '/users/account'
|
||||||
data: JSON.stringify({ provider: provider, uid: uid })
|
data: JSON.stringify({ provider: provider, uid: uid })
|
||||||
processData: true
|
processData: true
|
||||||
success: @success
|
success: @success
|
||||||
|
|
|
@ -38,7 +38,7 @@ class App.ProfilePassword extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'password_reset'
|
id: 'password_reset'
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
url: 'api/users/password_change'
|
url: @Config.get('api_path') + '/users/password_change'
|
||||||
data: JSON.stringify(params)
|
data: JSON.stringify(params)
|
||||||
processData: true
|
processData: true
|
||||||
success: @success
|
success: @success
|
||||||
|
|
|
@ -105,7 +105,7 @@ class App.TicketCreate extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'ticket_create'
|
id: 'ticket_create'
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/ticket_create'
|
url: @Config.get('api_path') + '/ticket_create'
|
||||||
data:
|
data:
|
||||||
ticket_id: params.ticket_id
|
ticket_id: params.ticket_id
|
||||||
article_id: params.article_id
|
article_id: params.article_id
|
||||||
|
@ -149,7 +149,7 @@ class App.TicketCreate extends App.Controller
|
||||||
|
|
||||||
# generate form
|
# generate form
|
||||||
configure_attributes = [
|
configure_attributes = [
|
||||||
{ name: 'customer_id', display: 'Customer', tag: 'autocompletion', type: 'text', limit: 200, null: false, relation: 'User', class: 'span7', autocapitalize: false, help: 'Select the customer of the Ticket or create one.', link: '<a href="" class="customer_new">»</a>', callback: @localUserInfo, source: 'api/users/search', minLengt: 2 },
|
{ name: 'customer_id', display: 'Customer', tag: 'autocompletion', type: 'text', limit: 200, null: false, relation: 'User', class: 'span7', autocapitalize: false, help: 'Select the customer of the Ticket or create one.', link: '<a href="" class="customer_new">»</a>', callback: @localUserInfo, source: @Config.get('api_path') + '/users/search', minLengt: 2 },
|
||||||
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: false, filter: @edit_form, nulloption: true, relation: 'Group', default: defaults['group_id'], class: 'span7', },
|
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: false, filter: @edit_form, nulloption: true, relation: 'Group', default: defaults['group_id'], class: 'span7', },
|
||||||
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, filter: @edit_form, nulloption: true, relation: 'User', default: defaults['owner_id'], class: 'span7', },
|
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, filter: @edit_form, nulloption: true, relation: 'User', default: defaults['owner_id'], class: 'span7', },
|
||||||
{ name: 'tags', display: 'Tags', tag: 'tag', type: 'text', null: true, default: defaults['tags'], class: 'span7', },
|
{ name: 'tags', display: 'Tags', tag: 'tag', type: 'text', null: true, default: defaults['tags'], class: 'span7', },
|
||||||
|
|
|
@ -13,7 +13,7 @@ class App.TicketHistory extends App.ControllerModal
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'ticket_history',
|
id: 'ticket_history',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/ticket_history/' + ticket_id,
|
url: @Config.get('api_path') + '/ticket_history/' + ticket_id,
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
# remember ticket
|
# remember ticket
|
||||||
@ticket = data.ticket
|
@ticket = data.ticket
|
||||||
|
|
|
@ -9,7 +9,7 @@ class App.TicketMerge extends App.ControllerModal
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'ticket_merge_list',
|
id: 'ticket_merge_list',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/ticket_merge_list/' + @ticket_id,
|
url: @Config.get('api_path') + '/ticket_merge_list/' + @ticket_id,
|
||||||
data: {
|
data: {
|
||||||
# view: @view
|
# view: @view
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ class App.TicketMerge extends App.ControllerModal
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'ticket_merge',
|
id: 'ticket_merge',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/ticket_merge/' + @ticket_id + '/' + params['master_ticket_number'],
|
url: @Config.get('api_path') + '/ticket_merge/' + @ticket_id + '/' + params['master_ticket_number'],
|
||||||
data: {
|
data: {
|
||||||
# view: @view
|
# view: @view
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ class Index extends App.ControllerContent
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'ticket_create',
|
id: 'ticket_create',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/ticket_create',
|
url: @Config.get('api_path') + '/ticket_create',
|
||||||
data: {
|
data: {
|
||||||
ticket_id: params.ticket_id,
|
ticket_id: params.ticket_id,
|
||||||
article_id: params.article_id,
|
article_id: params.article_id,
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Index extends App.ControllerContent
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'getting_started',
|
id: 'getting_started',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/getting_started',
|
url: @Config.get('api_path') + '/getting_started',
|
||||||
data: {
|
data: {
|
||||||
# view: @view,
|
# view: @view,
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ class App.LinkInfo extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'links_' + @object.id + '_' + @object_type,
|
id: 'links_' + @object.id + '_' + @object_type,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/links',
|
url: @Config.get('api_path') + '/links',
|
||||||
data: {
|
data: {
|
||||||
link_object: @object_type,
|
link_object: @object_type,
|
||||||
link_object_value: @object.id,
|
link_object_value: @object.id,
|
||||||
|
@ -83,7 +83,7 @@ class App.LinkInfo extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'links_remove_' + @object.id + '_' + @object_type,
|
id: 'links_remove_' + @object.id + '_' + @object_type,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/links/remove',
|
url: @Config.get('api_path') + '/links/remove',
|
||||||
data: {
|
data: {
|
||||||
link_type: link_type,
|
link_type: link_type,
|
||||||
link_object_source: link_object_source,
|
link_object_source: link_object_source,
|
||||||
|
@ -126,7 +126,7 @@ class App.LinkAdd extends App.ControllerModal
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'links_add_' + @object.id + '_' + @object_type,
|
id: 'links_add_' + @object.id + '_' + @object_type,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/links/add',
|
url: @Config.get('api_path') + '/links/add',
|
||||||
data: {
|
data: {
|
||||||
link_type: params['link_type'],
|
link_type: params['link_type'],
|
||||||
link_object_target: 'Ticket',
|
link_object_target: 'Ticket',
|
||||||
|
|
|
@ -86,7 +86,7 @@ class App.Navigation extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'ticket_search'
|
id: 'ticket_search'
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/search'
|
url: @Config.get('api_path') + '/search'
|
||||||
data:
|
data:
|
||||||
term: @term
|
term: @term
|
||||||
processData: true,
|
processData: true,
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Index extends App.ControllerContent
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'packages',
|
id: 'packages',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/packages',
|
url: @Config.get('api_path') + '/packages',
|
||||||
processData: true,
|
processData: true,
|
||||||
success: (data) =>
|
success: (data) =>
|
||||||
@render(data)
|
@render(data)
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Index extends App.ControllerContent
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'password_reset'
|
id: 'password_reset'
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
url: 'api/users/password_reset'
|
url: @Config.get('api_path') + '/users/password_reset'
|
||||||
data: JSON.stringify(params)
|
data: JSON.stringify(params)
|
||||||
processData: true
|
processData: true
|
||||||
success: @success
|
success: @success
|
||||||
|
@ -86,7 +86,7 @@ class Verify extends App.ControllerContent
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'password_reset_verify'
|
id: 'password_reset_verify'
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
url: 'api/users/password_reset_verify'
|
url: @Config.get('api_path') + '/users/password_reset_verify'
|
||||||
data: JSON.stringify(params)
|
data: JSON.stringify(params)
|
||||||
processData: true
|
processData: true
|
||||||
success: @render_success
|
success: @render_success
|
||||||
|
@ -122,7 +122,7 @@ class Verify extends App.ControllerContent
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'password_reset_verify'
|
id: 'password_reset_verify'
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
url: 'api/users/password_reset_verify'
|
url: @Config.get('api_path') + '/users/password_reset_verify'
|
||||||
data: JSON.stringify(params)
|
data: JSON.stringify(params)
|
||||||
processData: true
|
processData: true
|
||||||
success: @render_changed_success
|
success: @render_changed_success
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Session extends App.ControllerContent
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'sessions'
|
id: 'sessions'
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/sessions'
|
url: @Config.get('api_path') + '/sessions'
|
||||||
success: (data) =>
|
success: (data) =>
|
||||||
@render(data)
|
@render(data)
|
||||||
)
|
)
|
||||||
|
@ -45,7 +45,7 @@ class Session extends App.ControllerContent
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'sessions/' + sessionId
|
id: 'sessions/' + sessionId
|
||||||
type: 'DELETE'
|
type: 'DELETE'
|
||||||
url: 'api/sessions/' + sessionId
|
url: @Config.get('api_path') + '/sessions/' + sessionId
|
||||||
success: (data) =>
|
success: (data) =>
|
||||||
@load()
|
@load()
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,7 +12,7 @@ class App.TagWidget extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: @attribute_id
|
id: @attribute_id
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/tags'
|
url: @Config.get('api_path') + '/tags'
|
||||||
data:
|
data:
|
||||||
object: @object_type
|
object: @object_type
|
||||||
o_id: @object.id
|
o_id: @object.id
|
||||||
|
@ -42,7 +42,7 @@ class App.TagWidget extends App.Controller
|
||||||
onAddTag: (item) =>
|
onAddTag: (item) =>
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/tags/add',
|
url: @Config.get('api_path') + '/tags/add',
|
||||||
data:
|
data:
|
||||||
object: @object_type,
|
object: @object_type,
|
||||||
o_id: @object.id,
|
o_id: @object.id,
|
||||||
|
@ -55,7 +55,7 @@ class App.TagWidget extends App.Controller
|
||||||
onRemoveTag: (item) =>
|
onRemoveTag: (item) =>
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/tags/remove'
|
url: @Config.get('api_path') + '/tags/remove'
|
||||||
data:
|
data:
|
||||||
object: @object_type
|
object: @object_type
|
||||||
o_id: @object.id
|
o_id: @object.id
|
||||||
|
|
|
@ -5,7 +5,7 @@ class App.TicketCustomer extends App.ControllerModal
|
||||||
|
|
||||||
render: ->
|
render: ->
|
||||||
configure_attributes = [
|
configure_attributes = [
|
||||||
{ name: 'customer_id', display: 'Customer', tag: 'autocompletion', type: 'text', limit: 100, null: false, relation: 'User', class: 'span5', autocapitalize: false, help: 'Select the new customer of the Ticket.', source: 'api/users/search', minLengt: 2 },
|
{ name: 'customer_id', display: 'Customer', tag: 'autocompletion', type: 'text', limit: 100, null: false, relation: 'User', class: 'span5', autocapitalize: false, help: 'Select the new customer of the Ticket.', source: @Config.get('api_path') + '/users/search', minLengt: 2 },
|
||||||
]
|
]
|
||||||
|
|
||||||
@html App.view('agent_ticket_customer')()
|
@html App.view('agent_ticket_customer')()
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Index extends App.ControllerContent
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'ticket_overview_' + @key,
|
id: 'ticket_overview_' + @key,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: 'api/ticket_overviews',
|
url: @Config.get('api_path') + '/ticket_overviews',
|
||||||
data: {
|
data: {
|
||||||
view: @view,
|
view: @view,
|
||||||
view_mode: @view_mode,
|
view_mode: @view_mode,
|
||||||
|
@ -502,7 +502,7 @@ class Router extends App.Controller
|
||||||
else
|
else
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/ticket_overviews'
|
url: @Config.get('api_path') + '/ticket_overviews'
|
||||||
data:
|
data:
|
||||||
view: @view
|
view: @view
|
||||||
array: true
|
array: true
|
||||||
|
|
|
@ -67,7 +67,7 @@ class App.TicketZoom extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'ticket_zoom_' + ticket_id
|
id: 'ticket_zoom_' + ticket_id
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/ticket_full/' + ticket_id + '?do_not_log=' + @doNotLog
|
url: @Config.get('api_path') + '/ticket_full/' + ticket_id + '?do_not_log=' + @doNotLog
|
||||||
data:
|
data:
|
||||||
view: @view
|
view: @view
|
||||||
processData: true
|
processData: true
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
#= require_self
|
#= require_self
|
||||||
#= require_tree ./lib/app_init
|
#= require_tree ./lib/app_init
|
||||||
|
#= require ./config.js.coffee
|
||||||
#= require_tree ./models
|
#= require_tree ./models
|
||||||
#= require_tree ./controllers
|
#= require_tree ./controllers
|
||||||
#= require_tree ./views
|
#= require_tree ./views
|
||||||
|
|
|
@ -5,7 +5,7 @@ class App.Auth
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'login',
|
id: 'login',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '/signin',
|
url: App.Config.get('api_path') + '/signin',
|
||||||
data: JSON.stringify(params.data),
|
data: JSON.stringify(params.data),
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class App.Auth
|
||||||
id: 'login_check'
|
id: 'login_check'
|
||||||
async: false
|
async: false
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: '/signshow'
|
url: App.Config.get('api_path') + '/signshow'
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
# set login (config, session, ...)
|
# set login (config, session, ...)
|
||||||
|
@ -41,7 +41,7 @@ class App.Auth
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'logout'
|
id: 'logout'
|
||||||
type: 'DELETE'
|
type: 'DELETE'
|
||||||
url: '/signout'
|
url: App.Config.get('api_path') + '/signout'
|
||||||
success: =>
|
success: =>
|
||||||
|
|
||||||
# set logout (config, session, ...)
|
# set logout (config, session, ...)
|
||||||
|
|
|
@ -103,7 +103,7 @@ class _i18nSingleton extends Spine.Module
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'i18n-set-' + locale,
|
id: 'i18n-set-' + locale,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: '/translations/lang/' + locale,
|
url: App.Config.get('api_path') + '/translations/lang/' + locale,
|
||||||
async: false,
|
async: false,
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
|
|
||||||
|
|
|
@ -293,7 +293,7 @@ class _webSocketSingleton extends App.Controller
|
||||||
# call init request
|
# call init request
|
||||||
@_ajaxInitWorking = App.Com.ajax(
|
@_ajaxInitWorking = App.Com.ajax(
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
url: 'api/message_send'
|
url: @Config.get('api_path') + '/message_send'
|
||||||
data: JSON.stringify({ data: { action: 'login' } })
|
data: JSON.stringify({ data: { action: 'login' } })
|
||||||
processData: false
|
processData: false
|
||||||
queue: false
|
queue: false
|
||||||
|
@ -329,7 +329,7 @@ class _webSocketSingleton extends App.Controller
|
||||||
data = @queue.shift()
|
data = @queue.shift()
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
url: 'api/message_send'
|
url: @Config.get('api_path') + '/message_send'
|
||||||
data: JSON.stringify({ client_id: @client_id, data: data })
|
data: JSON.stringify({ client_id: @client_id, data: data })
|
||||||
processData: false
|
processData: false
|
||||||
queue: true
|
queue: true
|
||||||
|
@ -349,7 +349,7 @@ class _webSocketSingleton extends App.Controller
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'message_receive',
|
id: 'message_receive',
|
||||||
type: 'POST'
|
type: 'POST'
|
||||||
url: 'api/message_receive'
|
url: @Config.get('api_path') + '/message_receive'
|
||||||
data: JSON.stringify({ client_id: @client_id })
|
data: JSON.stringify({ client_id: @client_id })
|
||||||
processData: false
|
processData: false
|
||||||
success: (data) =>
|
success: (data) =>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class App.Model extends Spine.Model
|
class App.Model extends Spine.Model
|
||||||
@destroyBind: false
|
@destroyBind: false
|
||||||
|
@api_path: App.Config.get('api_path')
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.Channel extends App.Model
|
class App.Channel extends App.Model
|
||||||
@configure 'Channel', 'adapter', 'area', 'options', 'group_id', 'active', 'updated_at'
|
@configure 'Channel', 'adapter', 'area', 'options', 'group_id', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/channels'
|
@url: @api_path + '/channels'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.EmailAddress extends App.Model
|
class App.EmailAddress extends App.Model
|
||||||
@configure 'EmailAddress', 'realname', 'email', 'note', 'active', 'updated_at'
|
@configure 'EmailAddress', 'realname', 'email', 'note', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/email_addresses'
|
@url: @api_path + '/email_addresses'
|
||||||
|
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'realname', display: 'Realname', tag: 'input', type: 'text', limit: 250, 'null': false, 'class': 'span4' },
|
{ name: 'realname', display: 'Realname', tag: 'input', type: 'text', limit: 250, 'null': false, 'class': 'span4' },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.Group extends App.Model
|
class App.Group extends App.Model
|
||||||
@configure 'Group', 'name', 'assignment_timeout', 'follow_up_possible', 'follow_up_assignment', 'email_address_id', 'signature_id', 'note', 'active', 'updated_at'
|
@configure 'Group', 'name', 'assignment_timeout', 'follow_up_possible', 'follow_up_assignment', 'email_address_id', 'signature_id', 'note', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/groups'
|
@url: @api_path + '/groups'
|
||||||
|
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.History extends App.Model
|
class App.History extends App.Model
|
||||||
@configure 'History', 'name'
|
@configure 'History', 'name'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: '/histories'
|
@url: @api_path + '/histories'
|
||||||
|
|
||||||
@_fillUp: (data) ->
|
@_fillUp: (data) ->
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.HistoryAttribute extends App.Model
|
class App.HistoryAttribute extends App.Model
|
||||||
@configure 'HistoryAttribute', 'name'
|
@configure 'HistoryAttribute', 'name'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: '/history_attributes'
|
@url: @api_path + '/history_attributes'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.HistoryObject extends App.Model
|
class App.HistoryObject extends App.Model
|
||||||
@configure 'HistoryObject', 'name'
|
@configure 'HistoryObject', 'name'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: '/history_objects'
|
@url: @api_path + '/history_objects'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.HistoryType extends App.Model
|
class App.HistoryType extends App.Model
|
||||||
@configure 'HistoryType', 'name'
|
@configure 'HistoryType', 'name'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: '/history_types'
|
@url: @api_path + '/history_types'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.Organization extends App.Model
|
class App.Organization extends App.Model
|
||||||
@configure 'Organization', 'name', 'shared', 'note', 'active', 'updated_at'
|
@configure 'Organization', 'name', 'shared', 'note', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/organizations'
|
@url: @api_path + '/organizations'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
||||||
{ name: 'shared', display: 'Shared organiztion', tag: 'boolean', note: 'Customers in the organiztion can view each other items.', type: 'boolean', 'default': true, 'null': false, 'class': 'span4' },
|
{ name: 'shared', display: 'Shared organiztion', tag: 'boolean', note: 'Customers in the organiztion can view each other items.', type: 'boolean', 'default': true, 'null': false, 'class': 'span4' },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.Overview extends Spine.Model
|
class App.Overview extends Spine.Model
|
||||||
@configure 'Overview', 'name', 'link', 'prio', 'condition', 'order', 'group_by', 'view', 'user_id', 'organization_shared', 'role_id', 'order', 'group_by', 'active', 'updated_at'
|
@configure 'Overview', 'name', 'link', 'prio', 'condition', 'order', 'group_by', 'view', 'user_id', 'organization_shared', 'role_id', 'order', 'group_by', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/overviews'
|
@url: @api_path + '/overviews'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
||||||
{ name: 'link', display: 'URL', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
{ name: 'link', display: 'URL', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.PostmasterFilter extends App.Model
|
class App.PostmasterFilter extends App.Model
|
||||||
@configure 'PostmasterFilter', 'name', 'channel', 'match', 'perform', 'note', 'active', 'updated_at'
|
@configure 'PostmasterFilter', 'name', 'channel', 'match', 'perform', 'note', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/postmaster_filters'
|
@url: @api_path + '/postmaster_filters'
|
||||||
|
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 250, 'null': false, 'class': 'span4' },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 250, 'null': false, 'class': 'span4' },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.Role extends App.Model
|
class App.Role extends App.Model
|
||||||
@configure 'Role', 'name', 'note', 'active', 'updated_at'
|
@configure 'Role', 'name', 'note', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/roles'
|
@url: @api_path + '/roles'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
||||||
{ name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, 'null': true, 'class': 'span4' },
|
{ name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, 'null': true, 'class': 'span4' },
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.Setting extends App.Model
|
class App.Setting extends App.Model
|
||||||
@configure 'Setting', 'name', 'state'
|
@configure 'Setting', 'name', 'state'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/settings'
|
@url: @api_path + '/settings'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.Signature extends App.Model
|
class App.Signature extends App.Model
|
||||||
@configure 'Signature', 'name', 'body', 'note', 'active', 'updated_at'
|
@configure 'Signature', 'name', 'body', 'note', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/signatures'
|
@url: @api_path + '/signatures'
|
||||||
|
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.Sla extends App.Model
|
class App.Sla extends App.Model
|
||||||
@configure 'Sla', 'name', 'first_response_time', 'update_time', 'close_time', 'condition', 'timezone', 'data', 'active', 'updated_at'
|
@configure 'Sla', 'name', 'first_response_time', 'update_time', 'close_time', 'condition', 'timezone', 'data', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/slas'
|
@url: @api_path + '/slas'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false, 'class': 'span4' },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false, 'class': 'span4' },
|
||||||
{ name: 'first_response_time', display: 'First Response Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' },
|
{ name: 'first_response_time', display: 'First Response Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' },
|
||||||
|
|
|
@ -2,4 +2,4 @@ class App.Taskbar extends App.Model
|
||||||
@configure 'Taskbar', 'key', 'client_id', 'callback', 'state', 'params', 'prio', 'notify', 'active', 'updated_at'
|
@configure 'Taskbar', 'key', 'client_id', 'callback', 'state', 'params', 'prio', 'notify', 'active', 'updated_at'
|
||||||
# @extend Spine.Model.Local
|
# @extend Spine.Model.Local
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/taskbar'
|
@url: @api_path + '/taskbar'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.Template extends App.Model
|
class App.Template extends App.Model
|
||||||
@configure 'Template', 'name', 'options', 'group_ids', 'user_id', 'updated_at'
|
@configure 'Template', 'name', 'options', 'group_ids', 'user_id', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/templates'
|
@url: @api_path + '/templates'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.TextModule extends App.Model
|
class App.TextModule extends App.Model
|
||||||
@configure 'TextModule', 'name', 'keywords', 'content', 'active', 'group_ids', 'user_id', 'updated_at'
|
@configure 'TextModule', 'name', 'keywords', 'content', 'active', 'group_ids', 'user_id', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/text_modules'
|
@url: @api_path + '/text_modules'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, 'null': false, 'class': 'span4' },
|
||||||
{ name: 'keywords', display: 'Keywords', tag: 'input', type: 'text', limit: 100, 'null': true, 'class': 'span4' },
|
{ name: 'keywords', display: 'Keywords', tag: 'input', type: 'text', limit: 100, 'null': true, 'class': 'span4' },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.Ticket extends App.Model
|
class App.Ticket extends App.Model
|
||||||
@configure 'Ticket', 'number', 'title', 'group_id', 'owner_id', 'customer_id', 'ticket_state_id', 'ticket_priority_id', 'article', 'tags', 'updated_at'
|
@configure 'Ticket', 'number', 'title', 'group_id', 'owner_id', 'customer_id', 'ticket_state_id', 'ticket_priority_id', 'article', 'tags', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/tickets'
|
@url: @api_path + '/tickets'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'number', display: '#', tag: 'input', type: 'text', limit: 100, null: true, read_only: true, style: 'width: 8%' },
|
{ name: 'number', display: '#', tag: 'input', type: 'text', limit: 100, null: true, read_only: true, style: 'width: 8%' },
|
||||||
{ name: 'customer_id', display: 'Customer', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', autocapitalize: false, help: 'Select the customer of the Ticket or create one.', link: '<a href="" class="customer_new">»</a>' },
|
{ name: 'customer_id', display: 'Customer', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', autocapitalize: false, help: 'Select the customer of the Ticket or create one.', link: '<a href="" class="customer_new">»</a>' },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class App.TicketArticle extends App.Model
|
class App.TicketArticle extends App.Model
|
||||||
@configure 'TicketArticle', 'from', 'to', 'cc', 'subject', 'body', 'ticket_id', 'ticket_article_type_id', 'ticket_article_sender_id', 'internal', 'in_reply_to', 'form_id', 'updated_at'
|
@configure 'TicketArticle', 'from', 'to', 'cc', 'subject', 'body', 'ticket_id', 'ticket_article_type_id', 'ticket_article_sender_id', 'internal', 'in_reply_to', 'form_id', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/ticket_articles'
|
@url: @api_path + '/ticket_articles'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'ticket_id', display: 'TicketID', null: false, readonly: 1, },
|
{ name: 'ticket_id', display: 'TicketID', null: false, readonly: 1, },
|
||||||
{ name: 'from', display: 'From', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', },
|
{ name: 'from', display: 'From', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', },
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.TicketArticleSender extends App.Model
|
class App.TicketArticleSender extends App.Model
|
||||||
@configure 'TicketArticleSender', 'name', 'updated_at'
|
@configure 'TicketArticleSender', 'name', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: '/ticket_article_senders'
|
@url: @api_path + '/ticket_article_senders'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.TicketArticleType extends App.Model
|
class App.TicketArticleType extends App.Model
|
||||||
@configure 'TicketArticleType', 'name', 'updated_at'
|
@configure 'TicketArticleType', 'name', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: '/ticket_article_types'
|
@url: @api_path + '/ticket_article_types'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.TicketPriority extends App.Model
|
class App.TicketPriority extends App.Model
|
||||||
@configure 'TicketPriority', 'name', 'note', 'active', 'updated_at'
|
@configure 'TicketPriority', 'name', 'note', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/ticket_priorities'
|
@url: @api_path + '/ticket_priorities'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.TicketState extends App.Model
|
class App.TicketState extends App.Model
|
||||||
@configure 'TicketState', 'name', 'note', 'active'
|
@configure 'TicketState', 'name', 'note', 'active'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/ticket_states'
|
@url: @api_path + '/ticket_states'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class App.TicketStateType extends App.Model
|
class App.TicketStateType extends App.Model
|
||||||
@configure 'TicketStateType', 'name', 'note', 'active', 'updated_at'
|
@configure 'TicketStateType', 'name', 'note', 'active', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: '/ticket_state_types'
|
@url: @api_path + '/ticket_state_types'
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
class App.Translation extends App.Model
|
class App.Translation extends App.Model
|
||||||
@configure 'Translation', 'source', 'target', 'locale'
|
@configure 'Translation', 'source', 'target', 'locale'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
|
@url: @api_path + '/translations'
|
|
@ -1,7 +1,7 @@
|
||||||
class App.User extends App.Model
|
class App.User extends App.Model
|
||||||
@configure 'User', 'login', 'firstname', 'lastname', 'email', 'web', 'password', 'phone', 'fax', 'mobile', 'street', 'zip', 'city', 'country', 'organization_id', 'department', 'note', 'role_ids', 'group_ids', 'active', 'invite', 'updated_at'
|
@configure 'User', 'login', 'firstname', 'lastname', 'email', 'web', 'password', 'phone', 'fax', 'mobile', 'street', 'zip', 'city', 'country', 'organization_id', 'department', 'note', 'role_ids', 'group_ids', 'active', 'invite', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: 'api/users'
|
@url: @api_path + '/users'
|
||||||
|
|
||||||
# @hasMany 'roles', 'App.Role'
|
# @hasMany 'roles', 'App.Role'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class ActivityController < ApplicationController
|
class ActivityController < ApplicationController
|
||||||
before_filter :authentication_check
|
before_filter :authentication_check
|
||||||
|
|
||||||
# GET /api/activity_stream
|
# GET /api/v1/activity_stream
|
||||||
def activity_stream
|
def activity_stream
|
||||||
activity_stream = History.activity_stream_fulldata( current_user, params[:limit] )
|
activity_stream = History.activity_stream_fulldata( current_user, params[:limit] )
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/channels.json
|
GET /api/v1/channels.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -89,7 +89,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/channels.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/channels.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ curl http://localhost/api/channels.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/channels/#{id}.json
|
GET /api/v1/channels/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -112,7 +112,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/channels/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/channels/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ curl http://localhost/api/channels/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/channels.json
|
POST /api/v1/channels.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -148,7 +148,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/channels.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/channels.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ curl http://localhost/api/channels.json -v -u #{login}:#{password} -H "Content-T
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/channels/{id}.json
|
PUT /api/v1/channels/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -185,7 +185,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/channels.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/channels.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -197,13 +197,13 @@ curl http://localhost/api/channels.json -v -u #{login}:#{password} -H "Content-T
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
DELETE /api/channels/{id}.json
|
DELETE /api/v1/channels/{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/channels.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
curl http://localhost/api/v1/channels.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/email_addresses.json
|
GET /api/v1/email_addresses.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -41,7 +41,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/email_addresses.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/email_addresses.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ curl http://localhost/api/email_addresses.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/email_addresses/#{id}.json
|
GET /api/v1/email_addresses/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -62,7 +62,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/email_addresses/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/email_addresses/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ curl http://localhost/api/email_addresses/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/email_addresses.json
|
POST /api/v1/email_addresses.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/email_addresses.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/email_addresses.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ curl http://localhost/api/email_addresses.json -v -u #{login}:#{password} -H "Co
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/email_addresses/{id}.json
|
PUT /api/v1/email_addresses/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -123,7 +123,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/email_addresses.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/email_addresses.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ class GettingStartedController < ApplicationController
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/getting_started.json
|
GET /api/v1/getting_started.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/getting_started.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/getting_started.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/groups.json
|
GET /api/v1/groups.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -44,7 +44,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/groups.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/groups.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ curl http://localhost/api/groups.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/groups/#{id}.json
|
GET /api/v1/groups/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/groups/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/groups/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ curl http://localhost/api/groups/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/groups.json
|
POST /api/v1/groups.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -96,7 +96,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/groups.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/groups.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ curl http://localhost/api/groups.json -v -u #{login}:#{password} -H "Content-Typ
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/groups/{id}.json
|
PUT /api/v1/groups/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -128,7 +128,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/groups.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/groups.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class LinksController < ApplicationController
|
class LinksController < ApplicationController
|
||||||
before_filter :authentication_check
|
before_filter :authentication_check
|
||||||
|
|
||||||
# GET /api/links
|
# GET /api/v1/links
|
||||||
def index
|
def index
|
||||||
links = Link.list(
|
links = Link.list(
|
||||||
:link_object => params[:link_object],
|
:link_object => params[:link_object],
|
||||||
|
@ -39,7 +39,7 @@ class LinksController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /api/links/add
|
# POST /api/v1/links/add
|
||||||
def add
|
def add
|
||||||
|
|
||||||
# lookup object id
|
# lookup object id
|
||||||
|
@ -59,7 +59,7 @@ class LinksController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /api/links/remove
|
# DELETE /api/v1/links/remove
|
||||||
def remove
|
def remove
|
||||||
link = Link.remove(params)
|
link = Link.remove(params)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class LongPollingController < ApplicationController
|
class LongPollingController < ApplicationController
|
||||||
|
|
||||||
# GET /api/message_send
|
# GET /api/v1/message_send
|
||||||
def message_send
|
def message_send
|
||||||
new_connection = false
|
new_connection = false
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class LongPollingController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /api/message_receive
|
# GET /api/v1/message_receive
|
||||||
def message_receive
|
def message_receive
|
||||||
|
|
||||||
# check client id
|
# check client id
|
||||||
|
|
|
@ -25,7 +25,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/organizations.json
|
GET /api/v1/organizations.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -42,7 +42,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/organizations.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/organizations.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ curl http://localhost/api/organizations.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/organizations/#{id}.json
|
GET /api/v1/organizations/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -73,7 +73,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/organizations/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/organizations/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ curl http://localhost/api/organizations/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/organizations.json
|
POST /api/v1/organizations.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -114,7 +114,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/organizations.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true,"shared": true,"note": "some note"}'
|
curl http://localhost/api/v1/organizations.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true,"shared": true,"note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ curl http://localhost/api/organizations.json -v -u #{login}:#{password} -H "Cont
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/organizations/{id}.json
|
PUT /api/v1/organizations/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -145,7 +145,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/organizations.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"id": 1,"name": "some_name","active": true,"shared": true,"note": "some note"}'
|
curl http://localhost/api/v1/organizations.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"id": 1,"name": "some_name","active": true,"shared": true,"note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/overviews.json
|
GET /api/v1/overviews.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -47,7 +47,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/overviews.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/overviews.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ curl http://localhost/api/overviews.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/overviews/#{id}.json
|
GET /api/v1/overviews/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/overviews/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/overviews/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ curl http://localhost/api/overviews/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/overviews.json
|
POST /api/v1/overviews.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/overviews.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/overviews.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ curl http://localhost/api/overviews.json -v -u #{login}:#{password} -H "Content-
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/overviews/{id}.json
|
PUT /api/v1/overviews/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -137,7 +137,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/overviews.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/overviews.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -149,13 +149,13 @@ curl http://localhost/api/overviews.json -v -u #{login}:#{password} -H "Content-
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
DELETE /api/overviews/{id}.json
|
DELETE /api/v1/overviews/{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/overviews.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
curl http://localhost/api/v1/overviews.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class PackagesController < ApplicationController
|
class PackagesController < ApplicationController
|
||||||
before_filter :authentication_check
|
before_filter :authentication_check
|
||||||
|
|
||||||
# GET /api/packages
|
# GET /api/v1/packages
|
||||||
def index
|
def index
|
||||||
return if deny_if_not_role('Admin')
|
return if deny_if_not_role('Admin')
|
||||||
packages = Package.all( :order => 'name' )
|
packages = Package.all( :order => 'name' )
|
||||||
|
@ -12,7 +12,7 @@ class PackagesController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /api/packages
|
# POST /api/v1/packages
|
||||||
def install
|
def install
|
||||||
return if deny_if_not_role('Admin')
|
return if deny_if_not_role('Admin')
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ class PackagesController < ApplicationController
|
||||||
redirect_to '/#package'
|
redirect_to '/#package'
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /api/packages
|
# DELETE /api/v1/packages
|
||||||
def uninstall
|
def uninstall
|
||||||
return if deny_if_not_role('Admin')
|
return if deny_if_not_role('Admin')
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/postmaster_filters.json
|
GET /api/v1/postmaster_filters.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -49,7 +49,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/postmaster_filters.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/postmaster_filters.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ curl http://localhost/api/postmaster_filters.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/postmaster_filters/#{id}.json
|
GET /api/v1/postmaster_filters/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/postmaster_filters/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/postmaster_filters/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ curl http://localhost/api/postmaster_filters/#{id}.json -v -u #{login}:#{passwor
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/postmaster_filters.json
|
POST /api/v1/postmaster_filters.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -116,7 +116,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/postmaster_filters.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/postmaster_filters.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ curl http://localhost/api/postmaster_filters.json -v -u #{login}:#{password} -H
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/postmaster_filters/{id}.json
|
PUT /api/v1/postmaster_filters/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -159,7 +159,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/postmaster_filters.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/postmaster_filters.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ class RecentViewedController < ApplicationController
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/recent_viewed
|
GET /api/v1/recent_viewed
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/recent_viewed.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X GET
|
curl http://localhost/api/v1/recent_viewed.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X GET
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/roles.json
|
GET /api/v1/roles.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -41,7 +41,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/roles.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/roles.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ curl http://localhost/api/roles.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/roles/#{id}.json
|
GET /api/v1/roles/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -62,7 +62,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/roles/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/roles/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ curl http://localhost/api/roles/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/roles.json
|
POST /api/v1/roles.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -90,7 +90,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/roles.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/roles.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ curl http://localhost/api/roles.json -v -u #{login}:#{password} -H "Content-Type
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/roles/{id}.json
|
PUT /api/v1/roles/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/roles.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/roles.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ class RssController < ApplicationController
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/rss_fetch
|
GET /api/v1/rss_fetch
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/rss_fetch.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X GET
|
curl http://localhost/api/v1/rss_fetch.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X GET
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class SearchController < ApplicationController
|
class SearchController < ApplicationController
|
||||||
before_filter :authentication_check
|
before_filter :authentication_check
|
||||||
|
|
||||||
# GET /api/search
|
# GET /api/v1/search
|
||||||
def search
|
def search
|
||||||
|
|
||||||
# build result list
|
# build result list
|
||||||
|
|
|
@ -25,7 +25,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/signatures.json
|
GET /api/v1/signatures.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -42,7 +42,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/signatures.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/signatures.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ curl http://localhost/api/signatures.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/signatures/#{id}.json
|
GET /api/v1/signatures/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -63,7 +63,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/signatures/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/signatures/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ curl http://localhost/api/signatures/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/signatures.json
|
POST /api/v1/signatures.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/signatures.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/signatures.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ curl http://localhost/api/signatures.json -v -u #{login}:#{password} -H "Content
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/signatures/{id}.json
|
PUT /api/v1/signatures/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -120,7 +120,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/signatures.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/signatures.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/slas.json
|
GET /api/v1/slas.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -42,7 +42,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/slas.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/slas.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ curl http://localhost/api/slas.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/slas/#{id}.json
|
GET /api/v1/slas/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/slas/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/slas/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ curl http://localhost/api/slas/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/slas.json
|
POST /api/v1/slas.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/slas.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/slas.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ curl http://localhost/api/slas.json -v -u #{login}:#{password} -H "Content-Type:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/slas/{id}.json
|
PUT /api/v1/slas/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -122,7 +122,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/slas.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/slas.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -134,13 +134,13 @@ curl http://localhost/api/slas.json -v -u #{login}:#{password} -H "Content-Type:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
DELETE /api/slas/{id}.json
|
DELETE /api/v1/slas/{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/slas.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
curl http://localhost/api/v1/slas.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class TagsController < ApplicationController
|
class TagsController < ApplicationController
|
||||||
before_filter :authentication_check
|
before_filter :authentication_check
|
||||||
|
|
||||||
# GET /api/tags
|
# GET /api/v1/tags
|
||||||
def index
|
def index
|
||||||
list = Tag.list()
|
list = Tag.list()
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ class TagsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /api/tags
|
# GET /api/v1/tags
|
||||||
def list
|
def list
|
||||||
list = Tag.tag_list(
|
list = Tag.tag_list(
|
||||||
:object => params[:object],
|
:object => params[:object],
|
||||||
|
@ -26,7 +26,7 @@ class TagsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /api/tag/add
|
# POST /api/v1/tag/add
|
||||||
def add
|
def add
|
||||||
success = Tag.tag_add(
|
success = Tag.tag_add(
|
||||||
:object => params[:object],
|
:object => params[:object],
|
||||||
|
@ -40,7 +40,7 @@ class TagsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /api/tag/remove
|
# DELETE /api/v1/tag/remove
|
||||||
def remove
|
def remove
|
||||||
success = Tag.tag_remove(
|
success = Tag.tag_remove(
|
||||||
:object => params[:object],
|
:object => params[:object],
|
||||||
|
|
|
@ -25,7 +25,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/templates.json
|
GET /api/v1/templates.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -42,7 +42,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/templates.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/templates.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ curl http://localhost/api/templates.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/templates/#{id}.json
|
GET /api/v1/templates/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/templates/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/templates/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ curl http://localhost/api/templates/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/templates.json
|
POST /api/v1/templates.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/templates.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/templates.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ curl http://localhost/api/templates.json -v -u #{login}:#{password} -H "Content-
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/templates/{id}.json
|
PUT /api/v1/templates/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -120,7 +120,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/templates.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/templates.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -132,13 +132,13 @@ curl http://localhost/api/templates.json -v -u #{login}:#{password} -H "Content-
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
DELETE /api/templates/{id}.json
|
DELETE /api/v1/templates/{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/templates.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
curl http://localhost/api/v1/templates.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/text_modules.json
|
GET /api/v1/text_modules.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -44,7 +44,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/text_modules.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/text_modules.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ curl http://localhost/api/text_modules.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/text_modules/#{id}.json
|
GET /api/v1/text_modules/#{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/text_modules/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/text_modules/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ curl http://localhost/api/text_modules/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/text_modules.json
|
POST /api/v1/text_modules.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -94,7 +94,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/text_modules.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/text_modules.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ curl http://localhost/api/text_modules.json -v -u #{login}:#{password} -H "Conte
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/text_modules/{id}.json
|
PUT /api/v1/text_modules/{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -123,7 +123,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/text_modules.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
curl http://localhost/api/v1/text_modules.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"name": "some_name","active": true, "note": "some note"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -134,13 +134,13 @@ curl http://localhost/api/text_modules.json -v -u #{login}:#{password} -H "Conte
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
DELETE /api/text_modules/{id}.json
|
DELETE /api/v1/text_modules/{id}.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/text_modules.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
curl http://localhost/api/v1/text_modules.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X DELETE
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class TicketOverviewsController < ApplicationController
|
class TicketOverviewsController < ApplicationController
|
||||||
before_filter :authentication_check
|
before_filter :authentication_check
|
||||||
|
|
||||||
# GET /api/tickets
|
# GET /api/v1/tickets
|
||||||
def show
|
def show
|
||||||
|
|
||||||
# get navbar overview data
|
# get navbar overview data
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
class TicketsController < ApplicationController
|
class TicketsController < ApplicationController
|
||||||
before_filter :authentication_check
|
before_filter :authentication_check
|
||||||
|
|
||||||
# GET /api/tickets
|
# GET /api/v1/tickets
|
||||||
def index
|
def index
|
||||||
@tickets = Ticket.all
|
@tickets = Ticket.all
|
||||||
|
|
||||||
render :json => @tickets
|
render :json => @tickets
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /api/tickets/1
|
# GET /api/v1/tickets/1
|
||||||
def show
|
def show
|
||||||
@ticket = Ticket.find( params[:id] )
|
@ticket = Ticket.find( params[:id] )
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ class TicketsController < ApplicationController
|
||||||
render :json => @ticket
|
render :json => @ticket
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /api/tickets
|
# POST /api/v1/tickets
|
||||||
def create
|
def create
|
||||||
@ticket = Ticket.new( Ticket.param_validation( params[:ticket] ) )
|
@ticket = Ticket.new( Ticket.param_validation( params[:ticket] ) )
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ class TicketsController < ApplicationController
|
||||||
render :json => @ticket, :status => :created
|
render :json => @ticket, :status => :created
|
||||||
end
|
end
|
||||||
|
|
||||||
# PUT /api/tickets/1
|
# PUT /api/v1/tickets/1
|
||||||
def update
|
def update
|
||||||
@ticket = Ticket.find(params[:id])
|
@ticket = Ticket.find(params[:id])
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ class TicketsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /api/tickets/1
|
# DELETE /api/v1/tickets/1
|
||||||
def destroy
|
def destroy
|
||||||
@ticket = Ticket.find( params[:id] )
|
@ticket = Ticket.find( params[:id] )
|
||||||
|
|
||||||
|
@ -106,8 +106,8 @@ class TicketsController < ApplicationController
|
||||||
head :ok
|
head :ok
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /api/ticket_customer
|
# GET /api/v1/ticket_customer
|
||||||
# GET /api/tickets_customer
|
# GET /api/v1/tickets_customer
|
||||||
def ticket_customer
|
def ticket_customer
|
||||||
|
|
||||||
# return result
|
# return result
|
||||||
|
@ -120,7 +120,7 @@ class TicketsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /api/ticket_history/1
|
# GET /api/v1/ticket_history/1
|
||||||
def ticket_history
|
def ticket_history
|
||||||
|
|
||||||
# get ticket data
|
# get ticket data
|
||||||
|
@ -190,7 +190,7 @@ class TicketsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /api/ticket_merge_list/1
|
# GET /api/v1/ticket_merge_list/1
|
||||||
def ticket_merge_list
|
def ticket_merge_list
|
||||||
|
|
||||||
ticket = Ticket.find( params[:ticket_id] )
|
ticket = Ticket.find( params[:ticket_id] )
|
||||||
|
@ -231,7 +231,7 @@ class TicketsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /ticket_merge/1/1
|
# GET /api/v1/ticket_merge/1/1
|
||||||
def ticket_merge
|
def ticket_merge
|
||||||
|
|
||||||
# check master ticket
|
# check master ticket
|
||||||
|
@ -285,7 +285,7 @@ class TicketsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /ticket_full/1
|
# GET /api/v1/ticket_full/1
|
||||||
def ticket_full
|
def ticket_full
|
||||||
|
|
||||||
# permission check
|
# permission check
|
||||||
|
@ -380,7 +380,7 @@ class TicketsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /ticket_create/1
|
# GET /api/v1/ticket_create/1
|
||||||
def ticket_create
|
def ticket_create
|
||||||
|
|
||||||
# get attributes to update
|
# get attributes to update
|
||||||
|
@ -453,7 +453,7 @@ class TicketsController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /api/tickets/search
|
# GET /api/v1/tickets/search
|
||||||
def search
|
def search
|
||||||
|
|
||||||
# build result list
|
# build result list
|
||||||
|
|
|
@ -39,7 +39,7 @@ Example:
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/users.json
|
GET /api/v1/users.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
[
|
[
|
||||||
|
@ -56,7 +56,7 @@ Response:
|
||||||
]
|
]
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/users.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/users.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ curl http://localhost/api/users.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
GET /api/users/1.json
|
GET /api/v1/users/1.json
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
{
|
{
|
||||||
|
@ -88,7 +88,7 @@ Response:
|
||||||
},
|
},
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/users/#{id}.json -v -u #{login}:#{password}
|
curl http://localhost/api/v1/users/#{id}.json -v -u #{login}:#{password}
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ curl http://localhost/api/users/#{id}.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/users.json
|
POST /api/v1/users.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -126,7 +126,7 @@ Response:
|
||||||
},
|
},
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/users.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"login": "some_login","firstname": "some firstname","lastname": "some lastname","email": "some@example.com"}'
|
curl http://localhost/api/v1/users.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"login": "some_login","firstname": "some firstname","lastname": "some lastname","email": "some@example.com"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ curl http://localhost/api/users.json -v -u #{login}:#{password} -H "Content-Type
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/users/#{id}.json
|
PUT /api/v1/users/#{id}.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -273,7 +273,7 @@ Response:
|
||||||
},
|
},
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/users/2.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"login": "some_login","firstname": "some firstname","lastname": "some lastname","email": "some@example.com"}'
|
curl http://localhost/api/v1/users/2.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"login": "some_login","firstname": "some firstname","lastname": "some lastname","email": "some@example.com"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -316,13 +316,13 @@ curl http://localhost/api/users/2.json -v -u #{login}:#{password} -H "Content-Ty
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /api/users/1
|
# DELETE /api/v1/users/1
|
||||||
def destroy
|
def destroy
|
||||||
return if deny_if_not_role('Admin')
|
return if deny_if_not_role('Admin')
|
||||||
model_destory_render(User, params)
|
model_destory_render(User, params)
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /api/users/search
|
# GET /api/v1/users/search
|
||||||
def search
|
def search
|
||||||
|
|
||||||
if is_role('Customer') && !is_role('Admin') && !is_role('Agent')
|
if is_role('Customer') && !is_role('Admin') && !is_role('Agent')
|
||||||
|
@ -355,7 +355,7 @@ curl http://localhost/api/users/2.json -v -u #{login}:#{password} -H "Content-Ty
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/users/password_reset
|
POST /api/v1/users/password_reset
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -368,7 +368,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/users/password_reset.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"username": "some_username"}'
|
curl http://localhost/api/v1/users/password_reset.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"username": "some_username"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ curl http://localhost/api/users/password_reset.json -v -u #{login}:#{password} -
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/users/password_reset_verify
|
POST /api/v1/users/password_reset_verify
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -405,7 +405,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/users/password_reset_verify.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"token": "SoMeToKeN", "password" "new_password"}'
|
curl http://localhost/api/v1/users/password_reset_verify.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"token": "SoMeToKeN", "password" "new_password"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ curl http://localhost/api/users/password_reset_verify.json -v -u #{login}:#{pass
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
POST /api/users/password_change
|
POST /api/v1/users/password_change
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -439,7 +439,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/users/password_change.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"password_old": "password_old", "password_new": "password_new"}'
|
curl http://localhost/api/v1/users/password_change.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X POST -d '{"password_old": "password_old", "password_new": "password_new"}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -468,7 +468,7 @@ curl http://localhost/api/users/password_change.json -v -u #{login}:#{password}
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
PUT /api/users/preferences.json
|
PUT /api/v1/users/preferences.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -482,7 +482,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/users/preferences.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"language": "de", "notifications": true}'
|
curl http://localhost/api/v1/users/preferences.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"language": "de", "notifications": true}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@ -503,7 +503,7 @@ curl http://localhost/api/users/preferences.json -v -u #{login}:#{password} -H "
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
Resource:
|
Resource:
|
||||||
DELETE /api/users/account.json
|
DELETE /api/v1/users/account.json
|
||||||
|
|
||||||
Payload:
|
Payload:
|
||||||
{
|
{
|
||||||
|
@ -517,7 +517,7 @@ Response:
|
||||||
}
|
}
|
||||||
|
|
||||||
Test:
|
Test:
|
||||||
curl http://localhost/api/users/account.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"provider": "twitter", "uid": 581482342942}'
|
curl http://localhost/api/v1/users/account.json -v -u #{login}:#{password} -H "Content-Type: application/json" -X PUT -d '{"provider": "twitter", "uid": 581482342942}'
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,9 @@ module Zammad
|
||||||
# Use a different cache store in production
|
# Use a different cache store in production
|
||||||
config.cache_store = :file_store, 'tmp/cache/file_store'
|
config.cache_store = :file_store, 'tmp/cache/file_store'
|
||||||
|
|
||||||
|
# REST api path
|
||||||
|
config.api_path = '/api/v1'
|
||||||
|
|
||||||
# Enable threaded mode
|
# Enable threaded mode
|
||||||
config.threadsafe!
|
config.threadsafe!
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,6 @@ Zammad::Application.routes.draw do
|
||||||
files = Dir.glob( "#{dir}/routes/*.rb" )
|
files = Dir.glob( "#{dir}/routes/*.rb" )
|
||||||
for file in files
|
for file in files
|
||||||
require file
|
require file
|
||||||
ExtraRoutes.add(self)
|
ExtraRoutes.add(self, Rails.configuration.api_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
map.match '/api/activity_stream', :to => 'activity#activity_stream', :via => :get
|
map.match api_path + '/activity_stream', :to => 'activity#activity_stream', :via => :get
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# omniauth
|
# omniauth
|
||||||
map.match '/auth/:provider/callback', :to => 'sessions#create_omniauth',:via => [:post, :get, :puts, :delete]
|
map.match '/auth/:provider/callback', :to => 'sessions#create_omniauth',:via => [:post, :get, :puts, :delete]
|
||||||
|
|
||||||
# sso
|
# sso
|
||||||
map.match '/auth/sso', :to => 'sessions#create_sso', :via => [:post, :get]
|
map.match '/auth/sso', :to => 'sessions#create_sso', :via => [:post, :get]
|
||||||
|
|
||||||
# sessions
|
# sessions
|
||||||
map.match '/signin', :to => 'sessions#create', :via => :post
|
map.match api_path + '/signin', :to => 'sessions#create', :via => :post
|
||||||
map.match '/signshow', :to => 'sessions#show', :via => :get
|
map.match api_path + '/signshow', :to => 'sessions#show', :via => :get
|
||||||
map.match '/signout', :to => 'sessions#destroy', :via => [:get, :delete]
|
map.match api_path + '/signout', :to => 'sessions#destroy', :via => [:get, :delete]
|
||||||
|
|
||||||
map.match '/api/sessions', :to => 'sessions#list', :via => :get
|
map.match api_path + '/sessions', :to => 'sessions#list', :via => :get
|
||||||
map.match '/api/sessions/:id', :to => 'sessions#delete', :via => :delete
|
map.match api_path + '/sessions/:id', :to => 'sessions#delete', :via => :delete
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# channels
|
# channels
|
||||||
map.match '/api/channels', :to => 'channels#index', :via => :get
|
map.match api_path + '/channels', :to => 'channels#index', :via => :get
|
||||||
map.match '/api/channels/:id', :to => 'channels#show', :via => :get
|
map.match api_path + '/channels/:id', :to => 'channels#show', :via => :get
|
||||||
map.match '/api/channels', :to => 'channels#create', :via => :post
|
map.match api_path + '/channels', :to => 'channels#create', :via => :post
|
||||||
map.match '/api/channels/:id', :to => 'channels#update', :via => :put
|
map.match api_path + '/channels/:id', :to => 'channels#update', :via => :put
|
||||||
map.match '/api/channels/:id', :to => 'channels#destroy', :via => :delete
|
map.match api_path + '/channels/:id', :to => 'channels#destroy', :via => :delete
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# groups
|
# groups
|
||||||
map.match '/api/email_addresses', :to => 'email_addresses#index', :via => :get
|
map.match api_path + '/email_addresses', :to => 'email_addresses#index', :via => :get
|
||||||
map.match '/api/email_addresses/:id', :to => 'email_addresses#show', :via => :get
|
map.match api_path + '/email_addresses/:id', :to => 'email_addresses#show', :via => :get
|
||||||
map.match '/api/email_addresses', :to => 'email_addresses#create', :via => :post
|
map.match api_path + '/email_addresses', :to => 'email_addresses#create', :via => :post
|
||||||
map.match '/api/email_addresses/:id', :to => 'email_addresses#update', :via => :put
|
map.match api_path + '/email_addresses/:id', :to => 'email_addresses#update', :via => :put
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# getting_started
|
# getting_started
|
||||||
map.match '/api/getting_started', :to => 'getting_started#index', :via => :get
|
map.match api_path + '/getting_started', :to => 'getting_started#index', :via => :get
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# groups
|
# groups
|
||||||
map.match '/api/groups', :to => 'groups#index', :via => :get
|
map.match api_path + '/groups', :to => 'groups#index', :via => :get
|
||||||
map.match '/api/groups/:id', :to => 'groups#show', :via => :get
|
map.match api_path + '/groups/:id', :to => 'groups#show', :via => :get
|
||||||
map.match '/api/groups', :to => 'groups#create', :via => :post
|
map.match api_path + '/groups', :to => 'groups#create', :via => :post
|
||||||
map.match '/api/groups/:id', :to => 'groups#update', :via => :put
|
map.match api_path + '/groups/:id', :to => 'groups#update', :via => :put
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# links
|
# links
|
||||||
map.match '/api/links', :to => 'links#index', :via => :get
|
map.match api_path + '/links', :to => 'links#index', :via => :get
|
||||||
map.match '/api/links/add', :to => 'links#add', :via => :get
|
map.match api_path + '/links/add', :to => 'links#add', :via => :get
|
||||||
map.match '/api/links/remove', :to => 'links#remove', :via => :get
|
map.match api_path + '/links/remove', :to => 'links#remove', :via => :get
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# messages
|
# messages
|
||||||
map.match '/api/message_send', :to => 'long_polling#message_send', :via => [ :get, :post ]
|
map.match api_path + '/message_send', :to => 'long_polling#message_send', :via => [ :get, :post ]
|
||||||
map.match '/api/message_receive', :to => 'long_polling#message_receive', :via => [ :get, :post ]
|
map.match api_path + '/message_receive', :to => 'long_polling#message_receive', :via => [ :get, :post ]
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# networks
|
# networkss
|
||||||
map.resources :networks, :only => [:create, :show, :index, :update, :destroy]
|
map.match api_path + '/networks', :to => 'networks#index', :via => :get
|
||||||
|
map.match api_path + '/networks/:id', :to => 'networks#show', :via => :get
|
||||||
|
map.match api_path + '/networks', :to => 'networks#create', :via => :post
|
||||||
|
map.match api_path + '/networks/:id', :to => 'networks#update', :via => :put
|
||||||
|
map.match api_path + '/networks/:id', :to => 'networks#destroy',:via => :delete
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# organizations
|
# organizations
|
||||||
map.match '/api/organizations', :to => 'organizations#index', :via => :get
|
map.match api_path + '/organizations', :to => 'organizations#index', :via => :get
|
||||||
map.match '/api/organizations/:id', :to => 'organizations#show', :via => :get
|
map.match api_path + '/organizations/:id', :to => 'organizations#show', :via => :get
|
||||||
map.match '/api/organizations', :to => 'organizations#create', :via => :post
|
map.match api_path + '/organizations', :to => 'organizations#create', :via => :post
|
||||||
map.match '/api/organizations/:id', :to => 'organizations#update', :via => :put
|
map.match api_path + '/organizations/:id', :to => 'organizations#update', :via => :put
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# overviews
|
# overviews
|
||||||
map.match '/api/overviews', :to => 'overviews#index', :via => :get
|
map.match api_path + '/overviews', :to => 'overviews#index', :via => :get
|
||||||
map.match '/api/overviews/:id', :to => 'overviews#show', :via => :get
|
map.match api_path + '/overviews/:id', :to => 'overviews#show', :via => :get
|
||||||
map.match '/api/overviews', :to => 'overviews#create', :via => :post
|
map.match api_path + '/overviews', :to => 'overviews#create', :via => :post
|
||||||
map.match '/api/overviews/:id', :to => 'overviews#update', :via => :put
|
map.match api_path + '/overviews/:id', :to => 'overviews#update', :via => :put
|
||||||
map.match '/api/overviews/:id', :to => 'overviews#destroy', :via => :delete
|
map.match api_path + '/overviews/:id', :to => 'overviews#destroy', :via => :delete
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# overviews
|
# overviews
|
||||||
map.match '/api/packages', :to => 'packages#index', :via => :get
|
map.match api_path + '/packages', :to => 'packages#index', :via => :get
|
||||||
map.match '/api/packages', :to => 'packages#install', :via => :post
|
map.match api_path + '/packages', :to => 'packages#install', :via => :post
|
||||||
map.match '/api/packages', :to => 'packages#uninstall', :via => :delete
|
map.match api_path + '/packages', :to => 'packages#uninstall', :via => :delete
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# postmaster_filters
|
# postmaster_filters
|
||||||
map.match '/api/postmaster_filters', :to => 'postmaster_filters#index', :via => :get
|
map.match api_path + '/postmaster_filters', :to => 'postmaster_filters#index', :via => :get
|
||||||
map.match '/api/postmaster_filters/:id', :to => 'postmaster_filters#show', :via => :get
|
map.match api_path + '/postmaster_filters/:id', :to => 'postmaster_filters#show', :via => :get
|
||||||
map.match '/api/postmaster_filters', :to => 'postmaster_filters#create', :via => :post
|
map.match api_path + '/postmaster_filters', :to => 'postmaster_filters#create', :via => :post
|
||||||
map.match '/api/postmaster_filters/:id', :to => 'postmaster_filters#update', :via => :put
|
map.match api_path + '/postmaster_filters/:id', :to => 'postmaster_filters#update', :via => :put
|
||||||
map.match '/api/postmaster_filters/:id', :to => 'postmaster_filters#destroy', :via => :delete
|
map.match api_path + '/postmaster_filters/:id', :to => 'postmaster_filters#destroy', :via => :delete
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
map.match '/api/recent_viewed', :to => 'recent_viewed#recent_viewed', :via => :get
|
map.match api_path + '/recent_viewed', :to => 'recent_viewed#recent_viewed', :via => :get
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# roles
|
# roles
|
||||||
map.match '/api/roles', :to => 'roles#index', :via => :get
|
map.match api_path + '/roles', :to => 'roles#index', :via => :get
|
||||||
map.match '/api/roles/:id', :to => 'roles#show', :via => :get
|
map.match api_path + '/roles/:id', :to => 'roles#show', :via => :get
|
||||||
map.match '/api/roles', :to => 'roles#create', :via => :post
|
map.match api_path + '/roles', :to => 'roles#create', :via => :post
|
||||||
map.match '/api/roles/:id', :to => 'roles#update', :via => :put
|
map.match api_path + '/roles/:id', :to => 'roles#update', :via => :put
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# rss
|
# rss
|
||||||
map.match '/api/rss_fetch', :to => 'rss#fetch', :via => :get
|
map.match api_path + '/rss_fetch', :to => 'rss#fetch', :via => :get
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# search
|
# search
|
||||||
map.match '/api/search', :to => 'search#search', :via => [:get, :post]
|
map.match api_path + '/search', :to => 'search#search', :via => [:get, :post]
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# base objects
|
# base objects
|
||||||
map.match '/api/settings', :to => 'settings#index', :via => :get
|
map.match api_path + '/settings', :to => 'settings#index', :via => :get
|
||||||
map.match '/api/settings/:id', :to => 'settings#show', :via => :get
|
map.match api_path + '/settings/:id', :to => 'settings#show', :via => :get
|
||||||
map.match '/api/settings', :to => 'settings#create', :via => :post
|
map.match api_path + '/settings', :to => 'settings#create', :via => :post
|
||||||
map.match '/api/settings/:id', :to => 'settings#update', :via => :put
|
map.match api_path + '/settings/:id', :to => 'settings#update', :via => :put
|
||||||
map.match '/api/settings/:id', :to => 'settings#destroy', :via => :delete
|
map.match api_path + '/settings/:id', :to => 'settings#destroy', :via => :delete
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# groups
|
# signatures
|
||||||
map.match '/api/signatures', :to => 'signatures#index', :via => :get
|
map.match api_path + '/signatures', :to => 'signatures#index', :via => :get
|
||||||
map.match '/api/signatures/:id', :to => 'signatures#show', :via => :get
|
map.match api_path + '/signatures/:id', :to => 'signatures#show', :via => :get
|
||||||
map.match '/api/signatures', :to => 'signatures#create', :via => :post
|
map.match api_path + '/signatures', :to => 'signatures#create', :via => :post
|
||||||
map.match '/api/signatures/:id', :to => 'signatures#update', :via => :put
|
map.match api_path + '/signatures/:id', :to => 'signatures#update', :via => :put
|
||||||
map.match '/api/signatures/:id', :to => 'signatures#destroy', :via => :delete
|
map.match api_path + '/signatures/:id', :to => 'signatures#destroy', :via => :delete
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
module ExtraRoutes
|
module ExtraRoutes
|
||||||
def add(map)
|
def add(map, api_path)
|
||||||
|
|
||||||
# slas
|
# slas
|
||||||
map.match '/api/slas', :to => 'slas#index', :via => :get
|
map.match api_path + '/slas', :to => 'slas#index', :via => :get
|
||||||
map.match '/api/slas/:id', :to => 'slas#show', :via => :get
|
map.match api_path + '/slas/:id', :to => 'slas#show', :via => :get
|
||||||
map.match '/api/slas', :to => 'slas#create', :via => :post
|
map.match api_path + '/slas', :to => 'slas#create', :via => :post
|
||||||
map.match '/api/slas/:id', :to => 'slas#update', :via => :put
|
map.match api_path + '/slas/:id', :to => 'slas#update', :via => :put
|
||||||
map.match '/api/slas/:id', :to => 'slas#destroy', :via => :delete
|
map.match api_path + '/slas/:id', :to => 'slas#destroy', :via => :delete
|
||||||
|
|
||||||
end
|
end
|
||||||
module_function :add
|
module_function :add
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue