For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.ivfprovider.com/ivf-agency-ap-is/sperm-donor/account-profile/photos-and-videos-copy/llms.txt. For full documentation content, see https://docs.ivfprovider.com/ivf-agency-ap-is/sperm-donor/account-profile/photos-and-videos-copy/llms-full.txt.

# Upload Photo Video - PENDING

POST http://localhost:8000/api/sperm-donors/{id}/photos-videos
Content-Type: multipart/form-data

Reference: https://docs.ivfprovider.com/ivf-agency-ap-is/sperm-donor/account-profile/photos-and-videos-copy/upload-photo-video-pending

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/sperm-donors/{id}/photos-videos:
    post:
      operationId: upload-photo-video-pending
      summary: Upload Photo Video - PENDING
      tags:
        - >-
          subpackage_spermDonor.subpackage_spermDonor/accountProfile.subpackage_spermDonor/accountProfile/photosAndVideosCopy
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Sperm Donor_Account Profile_Photos and
                  Videos Copy_Upload Photo Video - PENDING_Response_200
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                category:
                  type: string
                  description: current,childhood
                photos_videos[0][file]:
                  type: string
                  format: binary
              required:
                - category
                - photos_videos[0][file]
servers:
  - url: http://localhost:8000
components:
  schemas:
    Sperm Donor_Account Profile_Photos and Videos Copy_Upload Photo Video - PENDING_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: >-
        Sperm Donor_Account Profile_Photos and Videos Copy_Upload Photo Video -
        PENDING_Response_200
  securitySchemes:
    oauth2Auth:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python
import requests

url = "http://localhost:8000/api/sperm-donors/21/photos-videos"

files = { "photos_videos[0][file]": "open('string', 'rb')" }
payload = { "category": "string" }
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'http://localhost:8000/api/sperm-donors/21/photos-videos';
const form = new FormData();
form.append('category', 'string');
form.append('photos_videos[0][file]', 'string');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8000/api/sperm-donors/21/photos-videos"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"category\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"photos_videos[0][file]\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/sperm-donors/21/photos-videos")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"category\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"photos_videos[0][file]\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8000/api/sperm-donors/21/photos-videos")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"category\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"photos_videos[0][file]\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8000/api/sperm-donors/21/photos-videos', [
  'multipart' => [
    [
        'name' => 'category',
        'contents' => 'string'
    ],
    [
        'name' => 'photos_videos[0][file]',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://localhost:8000/api/sperm-donors/21/photos-videos");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"category\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"photos_videos[0][file]\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "category",
    "value": "string"
  ],
  [
    "name": "photos_videos[0][file]",
    "fileName": "string"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/sperm-donors/21/photos-videos")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```