- GetInfo - User Info
Description
Returns the id of the vehicle owner who granted access to your application. This should be used as the static unique identifier for storing the access token and refresh token pair in your database. Note: A single user can own multiple vehicles, and multiple users can own the same vehicle.
package main
import(
"context"
"log"
gosdkv2 "github.com/smartcar/go-sdk-v2"
"github.com/smartcar/go-sdk-v2/pkg/models/shared"
)
func main() {
s := gosdkv2.New(
gosdkv2.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
ctx := context.Background()
res, err := s.User.GetInfo(ctx)
if err != nil {
log.Fatal(err)
}
if res.UserInfo != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
*operations.GetInfoResponse, error