Giter Site home page Giter Site logo

appstoreconnect's Introduction

AppStoreConnect

This is a .NET implementation of the App Store Connect API.

The authorization component is lifted directly from https://github.com/dersia/AppStoreConnect. The client APIs are generated from the App Store Connect OpenAPI specification.

This library has not been extensively tested and should not be used for production changes without first taking extreme care. Note that misuse or a bug in this library could result in unintended pricing, availability or legal status changes to your apps.

Repository Overview

There are three projects in the repo:

  • StudioDrydock.AppStoreConnect.Api
    The actual class library that contains the API for interacting with the App Store. This is the only library you need to link against for your own projects.
  • StudioDrydock.AppStoreConnect.ApiGenerator
    Command-line app that regenerates the source of StudioDrydock.AppStoreConnect.Api. Only required when the OpenAPI specification published by Apple changes (or to fix bugs in the generation).
  • StudioDrydock.AppStoreConnect.Cli
    Command-line app demonstrating usage of the API, with some basic functionality.

Authorization

The library requires an API key which you can generate at the Users and Access page on the App Store Connect portal. You will need:

  • Issuer ID
  • Key ID
  • Certificate (.p8 file)

To use this authorization with the sample app, save this information in ~/.config/AppStoreConnect.json:

{
  "keyId": "xxxxxxxxxx",
  "keyPath": "AppStoreConnect_xxxxxxxxxx.p8",
  "issuerId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Sample Code

The following sample code lists all apps with their IDs and bundle IDs:

using System.IO;
using StudioDrydock.AppStoreConnect.Api;

var api = new AppStoreClient(new StreamReader("path/to/key.p8"), "<key-id>", "<issuer-id>");

var apps = await api.GetApps();
foreach (var app in apps.data)
{
    Console.WriteLine($"{app.id}: {app.attributes.bundleId}");
}

API Usage

In general, to find the API for a particular endpoint, search AppStoreClient.g.cs for the endpoint you are looking for (e.g., /v1/apps), and this will reveal the corresponding API method. From there you can find the request and response object types and supported parameters.

CLI Usage

The accompanying CLI project is intended mostly as a testbed or demonstration, or as a starting point for your own projects. The program outputs custom JSON to stderr, or to a file if --output is specified. Run with --help for additional information.

Currently these commands are supported:

Get all applications

dotnet run -- get-apps

Writes summary information about all apps, including their IDs, which are required for other commands (note that an App ID is not its bundle ID).

Get application versions and localizations

dotnet run -- get-app-versions --appId=12345678 --state=READY_FOR_SALE --platform=MAC_OS --output=app.json

Writes summary and all localized data about specific app versions matching the given criteria. The --state and --platform arguments are optional, and filter the set of returned versions.

Update localizations

dotnet run -- set-app-versions --input=app.json

Reads localized data from the given input (in the same format output by get-app-versions) and updates any non-null fields.

For example, to use this to bulk-update translations for an app, use get-app-versions to create a file containing the current locale data, including the required IDs, update the translations in-place, then run set-app-versions.

appstoreconnect's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

wgq4812 zzymyn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.