For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://developer-dev.shipbob.dev/experimental/api/kitting/llms.txt. For full documentation content, see https://developer-dev.shipbob.dev/experimental/api/kitting/llms-full.txt.

# Upload Attachment


POST https://gateway-dev.shipbob.dev/Experimental/kitting:uploadAttachment

Uploads an attachment for a kitting work order action step. The returned GUID can be used when creating the work order action attachment.

Request must be sent as **multipart/form-data** with the following fields:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| file_name | string | Yes | The file name including extension (e.g. packaging-pic.jpg). Supported types: jpg, jpeg, png, pdf, csv, xlsx, xls, txt, gif, mp4. |
| file | file | Yes | The binary file content to upload. |


Reference: https://developer-dev.shipbob.dev/experimental/api/kitting/upload-attachment

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: api-experimental
  version: 1.0.0
paths:
  /Experimental/kitting:uploadAttachment:
    post:
      operationId: upload-attachment
      summary: |
        Upload Attachment
      description: >
        Uploads an attachment for a kitting work order action step. The returned
        GUID can be used when creating the work order action attachment.


        Request must be sent as **multipart/form-data** with the following
        fields:


        | Field | Type | Required | Description |

        |-------|------|----------|-------------|

        | file_name | string | Yes | The file name including extension (e.g.
        packaging-pic.jpg). Supported types: jpg, jpeg, png, pdf, csv, xlsx,
        xls, txt, gif, mp4. |

        | file | file | Yes | The binary file content to upload. |
      tags:
        - subpackage_kitting
      parameters:
        - name: Authorization
          in: header
          description: Authentication using Personal Access Token (PAT) token
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Kitting.AddAttachmentResponse'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Kitting.ApiError'
servers:
  - url: https://gateway-dev.shipbob.dev
components:
  schemas:
    Kitting.AddAttachmentResponse:
      type: object
      properties:
        attachment_name:
          type:
            - string
            - 'null'
          description: The name of the uploaded attachment.
        id:
          type:
            - string
            - 'null'
          description: The unique identifier of the uploaded attachment.
      description: Response returned after successfully uploading an attachment.
      title: Kitting.AddAttachmentResponse
    Kitting.ApiError:
      type: object
      properties:
        details:
          oneOf:
            - description: Any type
            - type: 'null'
        errors:
          type: array
          items:
            type: string
        message:
          type: string
        stackTrace:
          type:
            - string
            - 'null'
      title: Kitting.ApiError
  securitySchemes:
    PAT:
      type: http
      scheme: bearer
      description: Authentication using Personal Access Token (PAT) token
    OAuth2:
      type: http
      scheme: bearer
      description: OAuth2 authentication using JWT tokens

```

## SDK Code Examples

```python Kitting_uploadAttachment_example
import requests

url = "https://gateway-dev.shipbob.dev/Experimental/kitting:uploadAttachment"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Kitting_uploadAttachment_example
const url = 'https://gateway-dev.shipbob.dev/Experimental/kitting:uploadAttachment';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

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

```go Kitting_uploadAttachment_example
package main

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

func main() {

	url := "https://gateway-dev.shipbob.dev/Experimental/kitting:uploadAttachment"

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

	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 Kitting_uploadAttachment_example
require 'uri'
require 'net/http'

url = URI("https://gateway-dev.shipbob.dev/Experimental/kitting:uploadAttachment")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.post("https://gateway-dev.shipbob.dev/Experimental/kitting:uploadAttachment")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://gateway-dev.shipbob.dev/Experimental/kitting:uploadAttachment', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Kitting_uploadAttachment_example
using RestSharp;

var client = new RestClient("https://gateway-dev.shipbob.dev/Experimental/kitting:uploadAttachment");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Kitting_uploadAttachment_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://gateway-dev.shipbob.dev/Experimental/kitting:uploadAttachment")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```