Developer APIs
Connect an app to a collector’s cabinets using SOAP. Start with a read-only cabinet reader, then use the same sign-in flow for bottles, pours, wishlists and transfers.
Get access for your app
For My Bottle Collection, email support@mybottlecollection.com to request an application registration. For a self-hosted installation, contact its operator. Supply a display name, your exact HTTPS callback URL and the permissions your app needs. The operator provides the service origin and public client ID. Account holders then sign in and approve access for their own cabinets.
For the tutorial, request soap.read and the callback https://localhost:7243/callback. Use a verified account with a cabinet you can recognise. For a distributed mobile app, register an HTTPS callback controlled by the app, such as a verified Android App Link.
Check the host by opening its authentication WSDL. This XML document describes the operations, parameters and response types a SOAP tool can import. The links on this page use the current site’s origin. On another installation, use the origin supplied by its operator.
Build a read-only cabinet reader
This C# tutorial runs a small HTTPS app on your computer. At the end, your browser displays one line per accessible cabinet, such as Whisky shelf (Owner). The sample uses the .NET 10 SDK and its built-in HTTP and XML libraries.
1. Create the project
dotnet new web -n CabinetReader --framework net10.0
cd CabinetReader
dotnet dev-certs https --trust
Download the complete Program.cs and replace the template’s Program.cs with it. The development certificate is for the local HTTPS callback.
2. Set your registration and run
In PowerShell, replace both example values with those supplied by the operator. The origin contains the scheme and host, plus the port if required.
$env:MBC_ORIGIN = 'https://your-soap-host.example'
$env:MBC_CLIENT_ID = 'your-registered-client-id'
dotnet run --no-launch-profile
3. Sign in and read your cabinets
Open https://localhost:7243/. Sign in on the collection site and review the requested permission. After you approve, the browser returns to the local app and shows cabinet names and roles. An empty list is a successful response when the account has no cabinet memberships. Press Ctrl + C in the terminal to stop the app.
How the three calls fit together
- BeginSignIn. Generate a fresh random state and PKCE verifier. Send the client ID, callback, state and the unpadded base64url SHA-256 challenge to
AuthenticationService. Keep the verifier locally. Open the returned authorization URL in the user’s browser. - ExchangeCode. At the registered callback, check the state against the initiating browser session and handle denial. Send the one-time code, original verifier, client ID and callback through SOAP. The response contains
AccessTokenandExpiresInSeconds. The sample keeps the token in memory for the cabinet read. - ListCabinets. POST the SOAP envelope to
/soap/CabinetServicewith the bearer token in the HTTP header. EachCabinetSummaryincludes anId,NameandRole. Use a returned ID when callingBottleService.ListBottles.
See the ListCabinets request on the wire
POST /soap/CabinetService
Content-Type: text/xml; charset=utf-8
Authorization: Bearer <access-token>
SOAPAction: "urn:mybottlecollection:cabinets:v1/ICabinetSoapService/ListCabinets"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ListCabinets xmlns="urn:mybottlecollection:cabinets:v1"/>
</s:Body>
</s:Envelope>Service reference
Each service name opens its WSDL. Import the contracts your client uses and send the bearer token on each protected call. Desktop GetProfile requires the Windows desktop profile permission. Third-party clients can call ListCabinets directly after sign-in.
| Service WSDL | Operations |
|---|---|
| AuthenticationService | BeginSignIn, ExchangeCode, GetProfile (Windows desktop profile scope) |
| CabinetService | ListCabinets, GetCabinet |
| BottleService | ListBottles, GetBottle, GetHistory, GetRatings, CreateBottle, UpdateBottle, RecordPour, SaveRating, SaveMilestone, SaveDeparture, DeleteBottle, GetThumbnail, RemovePhoto |
| PhotoUploadService | UploadPhoto |
| WorkspaceService | CreateCabinet, SaveSettings, ListMembers, SaveMember, RemoveMember, ListAudit, GetWishlist, ListPurchases, Purchase |
| WishlistService | SaveWishlist |
| ExportService | ExportWorkbook |
| TransferService | PreviewCopy, CopyBottle, MoveBottle, OfferBottle, ListOutgoing, CancelOffer, ListIncoming, GetTransfer, GetTransferPhoto, AcceptTransfer, DeclineTransfer |
| SharingService | ListPublicLinks, GetPublicLink, CreatePublicLink, ReplacePublicLink, RevokePublicLink, ListRatingInvitations, RevokeRatingInvitation |
| InvitationsService | ListInvitations, Invite, RevokeInvitation, PreviewInvitation, AcceptInvitation |
| RatingMailService | InviteRaters |
Generate a typed client from the WSDL
In a .NET project in Visual Studio, open Connected Services, add a WCF Web Service Reference and paste the absolute authentication WSDL URL, including ?singleWsdl. Generate the reference, then repeat with the cabinet WSDL in a separate namespace. Use the generated methods for BeginSignIn, ExchangeCode and ListCabinets in the same order as the tutorial. Attach the bearer token to the outgoing HTTP Authorization header for protected operations. The service address for calls is the HTTPS endpoint without the WSDL query.
Request the permissions you need
soap.readcovers cabinet browsing, bottle details, thumbnails, ratings and history.soap.writecovers inventory edits, pours, milestones, ratings and photos.soap.cabinetcovers cabinet management, members, audit, wishlists, purchases and workbook export.soap.transfercovers copy, move and transfer workflows, including creating a receiving cabinet.soap.sharecovers public links and membership and rating invitations.
Scopes describe what the application may request. The signed-in user’s role determines what it can do in a particular cabinet. For example, recording a pour requires write permission and an Owner or Editor role. Export requires an Owner.
For versioned writes, read the current version first. For a completed pour, generate one request ID and retain it if the same pour must be retried. Preserve nullable quantities: an unknown remaining volume and a measured zero represent different bottle states.
Troubleshooting
- WSDL returns 404
- Confirm the origin and service name with the operator. SOAP and OAuth must be enabled on that installation.
- Unknown application or callback
- Check the client ID and exact registered callback, including the scheme, port, path and trailing slash.
- State mismatch, expired code or rejected verifier
- Start a fresh sign-in from the local app. Use the verifier that produced the challenge for that attempt.
- Sign-in required or access denied
- Read the SOAP fault as well as the HTTP status. Renew an expired session, then check the token audience, granted scope and cabinet role. Missing records and inaccessible records may both produce a 404 workflow fault.
- Conflict or too many requests
- On a 409 workflow fault, reload the record before choosing whether to reapply the change. On HTTP 429, wait before retrying. Keep passwords, authorization codes, verifiers and bearer tokens out of application logs.