# `NeedleApple.AppStoreServerAPI`
[🔗](https://github.com/zlibex/needle_apple/blob/v0.1.1/lib/needle_apple/app_store_server_api.ex#L1)

Utilities for [App Store Server API](https://developer.apple.com/documentation/appstoreserverapi).

# `build_auth_token!`

```elixir
@spec build_auth_token!(
  NeedleApple.Types.AppStoreConnect.issuer_id(),
  NeedleApple.Types.AppStoreConnect.key_id(),
  NeedleApple.Types.AppStoreConnect.private_key(),
  NeedleApple.Types.AppStoreConnect.bundle_id()
) :: String.t()
```

Builds a token to authorize HTTP requests.

> #### Note {: .info}
> Using a private key of the "In-App Purchase" type is sufficient.

After building it, use it in the `Authorization` header like this:

```text
Authorization: Bearer <JWT>
```

## More resources

  * [Generating JSON Web Tokens for API requests](https://developer.apple.com/documentation/appstoreserverapi/generating_json_web_tokens_for_api_requests)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
