5.3 KiB
\ReferralAPI
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| GetReferral | Get /v1/referral | Returns the caller's referral code, share link and the referrals they have made. |
| PostReferralClaim | Post /v1/referral/claim | Records that the caller's org signed up through a referral code. |
| PutReferral | Put /v1/referral | Updates the caller's referral code and returns the updated referral summary. |
GetReferral
ReferralMyReferrals GetReferral(ctx).Execute()
Returns the caller's referral code, share link and the referrals they have made.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ReferralAPI.GetReferral(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ReferralAPI.GetReferral``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetReferral`: ReferralMyReferrals
fmt.Fprintf(os.Stdout, "Response from `ReferralAPI.GetReferral`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiGetReferralRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PostReferralClaim
ReferralClaimView PostReferralClaim(ctx).ReferralClaimRequest(referralClaimRequest).Execute()
Records that the caller's org signed up through a referral code.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
referralClaimRequest := *openapiclient.NewReferralClaimRequest() // ReferralClaimRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ReferralAPI.PostReferralClaim(context.Background()).ReferralClaimRequest(referralClaimRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ReferralAPI.PostReferralClaim``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostReferralClaim`: ReferralClaimView
fmt.Fprintf(os.Stdout, "Response from `ReferralAPI.PostReferralClaim`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiPostReferralClaimRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| referralClaimRequest | ReferralClaimRequest |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PutReferral
ReferralMyReferrals PutReferral(ctx).ReferralSetCodeRequest(referralSetCodeRequest).Execute()
Updates the caller's referral code and returns the updated referral summary.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
referralSetCodeRequest := *openapiclient.NewReferralSetCodeRequest() // ReferralSetCodeRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ReferralAPI.PutReferral(context.Background()).ReferralSetCodeRequest(referralSetCodeRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ReferralAPI.PutReferral``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PutReferral`: ReferralMyReferrals
fmt.Fprintf(os.Stdout, "Response from `ReferralAPI.PutReferral`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiPutReferralRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| referralSetCodeRequest | ReferralSetCodeRequest |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]