diff --git a/cli/message.go b/cli/message.go index e69a3310a6d..4c690a9d04b 100644 --- a/cli/message.go +++ b/cli/message.go @@ -25,7 +25,7 @@ var cmdMessages = []cobra.Command{ }, }, { - Use: "read ", + Use: "read ", Short: "Read messages", Long: `Reads all channel messages`, Run: func(cmd *cobra.Command, args []string) { diff --git a/pkg/sdk/go/bootstrap.go b/pkg/sdk/go/bootstrap.go index 61d5e3050d5..55aae01f2fa 100644 --- a/pkg/sdk/go/bootstrap.go +++ b/pkg/sdk/go/bootstrap.go @@ -9,6 +9,7 @@ import ( "net/http" "strings" + "github.com/mainflux/mainflux/internal/apiutil" "github.com/mainflux/mainflux/pkg/errors" ) @@ -125,9 +126,9 @@ func (sdk mfSDK) RemoveBootstrap(id, token string) errors.SDKError { return err } -func (sdk mfSDK) Bootstrap(externalKey, externalID string) (BootstrapConfig, errors.SDKError) { +func (sdk mfSDK) Bootstrap(externalID, externalKey string) (BootstrapConfig, errors.SDKError) { url := fmt.Sprintf("%s/%s/%s", sdk.bootstrapURL, bootstrapEndpoint, externalID) - _, body, err := sdk.processRequest(http.MethodGet, url, externalKey, string(CTJSON), nil, http.StatusOK) + _, body, err := sdk.processRequest(http.MethodGet, url, apiutil.ThingPrefix+externalKey, string(CTJSON), nil, http.StatusOK) if err != nil { return BootstrapConfig{}, err } diff --git a/pkg/sdk/go/sdk.go b/pkg/sdk/go/sdk.go index f94ae4d9c7a..9462951e7a7 100644 --- a/pkg/sdk/go/sdk.go +++ b/pkg/sdk/go/sdk.go @@ -230,7 +230,7 @@ type SDK interface { RemoveBootstrap(id, token string) errors.SDKError // Bootstrap returns Config to the Thing with provided external ID using external key. - Bootstrap(externalKey, externalID string) (BootstrapConfig, errors.SDKError) + Bootstrap(externalID, externalKey string) (BootstrapConfig, errors.SDKError) // Whitelist updates Thing state Config with given ID belonging to the user identified by the given token. Whitelist(cfg BootstrapConfig, token string) errors.SDKError