Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 487 Bytes

bot_auth.md

File metadata and controls

14 lines (11 loc) · 487 Bytes

Mixin bot access Mixin Route API demo

  1. use https://github.com/MixinNetwork/bot-api-go-client/blob/master/botauth.go

  2. include 2 headers when making HTTP requests

mixinRouteBotId := "61cb8dd4-16b1-4744-ba0c-7b2d2e52fc59"
client := bot.NewDefaultClient(su, logger)
ts := time.Now().Unix()
signature, _ := client.SignRequest(ctx, ts, mixinRouteBotId, request)
request.Header.Add("MR-ACCESS-TIMESTAMP", fmt.Sprintf("%d", ts))
request.Header.Add("MR-ACCESS-SIGN", signature)