Content-Length: 301049 | pFad | http://github.com/nicklaw5/helix/blob/main/docs/drops_docs.md

60 helix/docs/drops_docs.md at main · nicklaw5/helix · GitHub
Skip to content

Latest commit

 

History

History
137 lines (108 loc) · 2.67 KB

drops_docs.md

File metadata and controls

137 lines (108 loc) · 2.67 KB

Drops Documentation

Get Drops

Example 1 - Get drops entitlements for a game

This is an example of how to get entitlements for all users of a game.

client, err := helix.NewClient(&helix.Options{
    ClientID: "your-client-id",
})
if err != nil {
    // handle error
}

resp, err := client.GetDropsEntitlements(&helix.GetDropEntitlementsParams{
	GameID: "your-game-id",
})
if err != nil {
    // handle error
}

fmt.Printf("%+v\n", resp)

Example 2 - Get drops entitlements for a user

This is an example of how to get entitlements for a specific user.

client, err := helix.NewClient(&helix.Options{
    ClientID: "your-client-id",
})
if err != nil {
    // handle error
}

resp, err := client.GetDropsEntitlements(&helix.GetDropEntitlementsParams{
	UserID: "your-game-id",
})
if err != nil {
    // handle error
}

fmt.Printf("%+v\n", resp)

Example 3 - Get drops entitlements next page of results

This is an example of how to get multiple pages of entitlement results.

client, err := helix.NewClient(&helix.Options{
    ClientID: "your-client-id",
})
if err != nil {
    // handle error
}

// First page 
resp, err := client.GetDropsEntitlements(&helix.GetDropEntitlementsParams{
	GameID: "your-game-id",
    After: "",
    First: 50,
})
if err != nil {
    // handle error
}

fmt.Printf("%+v\n", resp)

// Next page
resp, err = client.GetDropsEntitlements(&helix.GetDropEntitlementsParams{
	GameID: "your-game-id",
    After: resp.Data.Pagination.Cursor,
    First: 50,
})
if err != nil {
    // handle error
}

fmt.Printf("%+v\n", resp)

Example 4 - Get drops entitlements filtered by fulfillment status

This is an example of how to get entitlements for a specific fulfillment status.

client, err := helix.NewClient(&helix.Options{
    ClientID: "your-client-id",
})
if err != nil {
    // handle error
}

resp, err := client.GetDropsEntitlements(&helix.GetDropEntitlementsParams{
	UserID: "your-game-id",
    FulfillmentStatus: "CLAIMED"
})
if err != nil {
    // handle error
}

fmt.Printf("%+v\n", resp)

Update Drops Entitlements

Example 1 - Update drops entitlemetns

This is an example of how to update drops entitlements status.

client, err := helix.NewClient(&helix.Options{
    ClientID: "your-client-id",
})
if err != nil {
    // handle error
}

resp, err := client.UpdateDropsEntitlements(&helix.UpdateDropsEntitlementsParams{
	EntitlementIDs: ["entitlement-id-1", "entitlement-id-2"],
	FulfillmentStatus: "FULFILLED",
})
if err != nil {
    // handle error
}

// Check which of the requested ids were updated
for _, es := range resp.Data.EntitlementSets {
    if es.Status == "SUCCESS" {
        fmt.Printf("%+v\n", es.IDs)
    }
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/nicklaw5/helix/blob/main/docs/drops_docs.md

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy