# Comprehensive Summary: Procedures for BAR API Operations

## 1. Introduction and Context

This contribution addresses procedures for Base Avatar Repository (BAR) APIs that were defined in Rel-19 as part of the AvCall-MED work item and integrated into TS 26.264 Annex B. The document was originally presented as S4-251909 at SA4#134 meeting but was redirected to the Rel-20 FS_Avatar_Ph2_MED study. The contribution provides detailed operational procedures for BAR APIs enabling UE or MF interaction with the Base Avatar Repository.

## 2. Base Avatar Models API Procedures

### 2.1 Create Base Avatar Model

**Procedure Flow:**
- Requestor (DC AS or MF) invokes `Mbar_Management_Avatars_CreateBaseAvatarModel` via HTTP POST
- Binary ARF container included in request body
- BAR authenticates/authorizes request
- Upon authorization, BAR stores ARF container locally and creates Avatar resource entity with globally unique identifier
- Response: 201 Created with Avatar resource entity

**Request Information Elements:**
- Security credentials (M)
- Binary ARF container (M)

**Response Information Elements:**
- Avatar resource entity (CM) - present on successful creation

**Note:** DC AS or BAR apply restrictions on created avatar container (location access, User ID authentication, etc.)

### 2.2 Get Base Avatar Model

**Procedure Flow:**
- Requestor invokes `Mbar_Management_BaseAvatarModels_GetBaseAvatarModel` via HTTP GET
- `{avatarId}` replaced in resource path
- BAR retrieves ARF container corresponding to avatarId
- Response: 200 OK with Avatar resource and binary ARF container

**Request Information Elements:**
- Security credentials (M)

**Response Information Elements:**
- Avatar resource entity (M)
- Binary container (M)

### 2.3 Update Base Avatar Model

**Procedure Flow:**
- Requestor invokes `Mbar_Management_Avatars_UpdateBaseAvatarModel` via HTTP PUT or PATCH
- **HTTP PUT:** Binary ARF container in body (full replacement)
- **HTTP PATCH:** Multipart/mixed message per RFC 2046 with asset identifiers list and binary assets
- BAR authenticates/authorizes and performs update
- Response: 200 OK with updated Avatar resource entity

**Request Information Elements:**
- Security credentials (M)
- Binary container (CM) - PUT only
- AssetIds (CM) - PATCH only
- Assets (CM) - PATCH only

**Response Information Elements:**
- Avatar resource entity (CM) - present on successful update

### 2.4 Delete Base Avatar Model

**Procedure Flow:**
- Requestor invokes `Mbar_Managment_Avatars_DeleteBaseAvatarModel` via HTTP DELETE
- BAR authenticates/authorizes request
- Upon authorization, BAR deletes ARF container and destroys resource
- Response: 204 No Content

**Request Information Elements:**
- Security credentials (M)

**Response:** No payload

## 3. Assets API Procedures

### 3.1 Create Asset

**Procedure Flow:**
- Requestor invokes `Mbar_Management_Assets_CreateAsset` via HTTP POST
- `{avatarId}` replaced in resource path
- BAR retrieves avatar container and adds binary asset
- Response: 201 Created with assetId

**Request Information Elements:**
- Security credentials (M)
- Binary asset (M)

**Response Information Elements:**
- Avatar resource entity (M) - updated container with new asset

### 3.2 Retrieve Asset

**Procedure Flow:**
- Requestor invokes `Mbar_Management_Assets_RetrieveAsset` via HTTP GET
- `{avatarId}` and `{assetId}` replaced in resource path
- BAR retrieves ARF container and extracts asset
- Response: 200 OK with binary asset

**Request Information Elements:**
- Security credentials (M)

**Response Information Elements:**
- Binary asset (M)

### 3.3 Update Asset

**Procedure Flow:**
- Requestor invokes `Mbar_Management_Assets_UpdateAsset` via HTTP PUT or PATCH
- **HTTP PUT:** Binary asset in body (full replacement)
- **HTTP PATCH:** Multipart/mixed message with LoDs/components to replace
- BAR authenticates/authorizes and performs update
- Response: 200 OK with updated Avatar resource entity

**Request Information Elements:**
- Requestor identifier (M)
- Security credentials (M)
- Asset (CM)

**Response Information Elements:**
- Avatar resource entity (CM) - present on successful update

### 3.4 Delete Asset

**Procedure Flow:**
- Requestor invokes `Mbar_Management_Assets_DestroyAsset` via HTTP DELETE
- BAR authenticates/authorizes request
- Upon authorization, retrieves ARF container, deletes asset, and may repackage container
- Response: 204 No Content

**Request Information Elements:**
- Security credentials (M)

**Response:** No payload

## 4. Avatar Representations API Procedures

### 4.1 Create Avatar Representation

**Procedure Flow:**
- Requestor invokes `Mbar_Management_AvatarRepresentations_CreateAvatarRepresentation` via HTTP POST
- Request body includes Avatar Representation resource without `avatarRepresentationId`
- BAR authenticates/authorizes and creates AvatarRepresentation resource entity with globally unique identifier
- Response: 201 Created

**Request Information Elements:**
- Security credentials (M)
- Avatar representation (M) - with avatarId and assetIds properties set

**Response Information Elements:**
- AvatarRepresentation resource entity (CM) - present on successful creation

### 4.2 Retrieve Avatar Representation

**Procedure Flow:**
- Requestor invokes `Mbar_Management_AvatarRepresentations_GetAvatarRepresentation` via HTTP GET
- `{avatarId}` replaced in resource path
- BAR retrieves assets listed in Avatar Representation and compiles container
- Response: 200 OK with Avatar Representation resource and binary container

**Request Information Elements:**
- Security credentials (M)

**Response Information Elements:**
- AvatarRepresentation resource entity (M)
- Binary container (M)

### 4.3 Update Avatar Representation

**Procedure Flow:**
- Requestor invokes `Mbar_Management_Avatar_Representations_UpdateAvatarRepresentation` via HTTP PUT or PATCH
- **HTTP PUT:** Avatar Representation object in body (full replacement)
- **HTTP PATCH:** Multipart/mixed message with asset identifier mappings (source to replacement) or map data structure
- Only asset identifiers existing in respective Avatar resource are allowed
- BAR authenticates/authorizes and performs update
- Response: 200 OK with updated Avatar Representation resource entity

**Note:** Only avatar representation owner allowed to modify representation

**Request Information Elements:**
- Security credentials (M)
- Avatar Representation (CM) - PUT only
- Source Asset Ids (CM) - PATCH only
- New Asset Ids (CM) - PATCH only

**Response Information Elements:**
- AvatarRepresentation resource entity (CM) - present on successful update

### 4.4 Destroy Avatar Representation

**Procedure Flow:**
- Requestor invokes `Mbar_Management_AvatarRepresentations_DeleteAvatarRepresentation` via HTTP DELETE
- BAR authenticates/authorizes and deletes Avatar Representation resource
- Response: 204 No Content (or 200 OK if response body needed)

**Request Information Elements:**
- Security credentials (M)

**Response:** No payload

## 5. Associated Information API Procedures

### 5.1 Retrieve Associated Information

**Procedure Flow:**
- Requestor invokes `Mbar_Management_AssociatedInformation_GetAssoicatedInformation` via HTTP GET
- `{avatarId}` replaced in resource path
- BAR retrieves AssociatedInfo object from Avatar Representation resource
- Response: 200 OK with AssociatedInfo object

**Request Information Elements:**
- Security credentials (M)

**Response Information Elements:**
- AssociatedInfo object (M)

## 6. Proposal

The contribution proposes to:
- Document section 2 contents as new clause 8.3.3.4 in aggregated CR to TR 26.813
- Add editor's note to clause 8.3.3.2 indicating need for updates to reflect BAR APIs defined in TS 26.264

## 7. References

IETF RFC 2046: "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types"