1
0
mirror of synced 2024-11-21 20:46:05 +03:00

update api endpoint

This commit is contained in:
Alex Lushpai 2018-07-21 18:56:25 +03:00
parent 961d180c6a
commit 7dd44201bf
2 changed files with 7 additions and 7 deletions

View File

@ -40,7 +40,7 @@ func (c *MgClient) ActivateTransportChannel(request Channel) (ActivateResponse,
var resp ActivateResponse
outgoing, _ := json.Marshal(&request)
data, status, err := c.PostRequest("/transport/channels", []byte(outgoing))
data, status, err := c.PostRequest("/channels", []byte(outgoing))
if err != nil {
return resp, status, err
}
@ -79,7 +79,7 @@ func (c *MgClient) UpdateTransportChannel(request Channel) (UpdateResponse, int,
var resp UpdateResponse
outgoing, _ := json.Marshal(&request)
data, status, err := c.PutRequest(fmt.Sprintf("/transport/channels/%d", request.ID), []byte(outgoing))
data, status, err := c.PutRequest(fmt.Sprintf("/channels/%d", request.ID), []byte(outgoing))
if err != nil {
return resp, status, err
}
@ -113,7 +113,7 @@ func (c *MgClient) DeactivateTransportChannel(id uint64) (DeleteResponse, int, e
var buf []byte
data, status, err := c.DeleteRequest(
fmt.Sprintf("/transport/channels/%s", strconv.FormatUint(id, 10)),
fmt.Sprintf("/channels/%s", strconv.FormatUint(id, 10)),
buf,
)
if err != nil {
@ -164,7 +164,7 @@ func (c *MgClient) Messages(request SendData) (MessagesResponse, int, error) {
var resp MessagesResponse
outgoing, _ := json.Marshal(&request)
data, status, err := c.PostRequest("/transport/messages", []byte(outgoing))
data, status, err := c.PostRequest("/messages", []byte(outgoing))
if err != nil {
return resp, status, err
}
@ -208,7 +208,7 @@ func (c *MgClient) UpdateMessages(request UpdateData) (MessagesResponse, int, er
var resp MessagesResponse
outgoing, _ := json.Marshal(&request)
data, status, err := c.PutRequest("/transport/messages", []byte(outgoing))
data, status, err := c.PutRequest("/messages", []byte(outgoing))
if err != nil {
return resp, status, err
}
@ -249,7 +249,7 @@ func (c *MgClient) DeleteMessage(request DeleteData) (MessagesResponse, int, err
outgoing, _ := json.Marshal(&request)
data, status, err := c.DeleteRequest(
"/transport/messages/",
"/messages/",
[]byte(outgoing),
)
if err != nil {

View File

@ -8,7 +8,7 @@ import (
"net/http"
)
var prefix = "/api/v1"
var prefix = "/api/transport/v1"
// GetRequest implements GET Request
func (c *MgClient) GetRequest(urlWithParameters string) ([]byte, int, error) {