For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.wisboo.com/wisboo-api/llms.txt. For full documentation content, see https://docs.wisboo.com/wisboo-api/llms-full.txt.

# Grant access to product

POST https://api.wisboo.com/v3/public/products/{product_id}/access
Content-Type: application/json

Permite dar acceso a un producto a un usuario específico. El ID del usuario debe enviarse como parte del cuerpo del request.

Reference: https://docs.wisboo.com/wisboo-api/grant-access-to-product

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /v3/public/products/{product_id}/access:
    post:
      operationId: grant-access-to-product
      summary: Grant access to product
      description: >-
        Permite dar acceso a un producto a un usuario específico. El ID del
        usuario debe enviarse como parte del cuerpo del request.
      tags:
        - ''
      parameters:
        - name: product_id
          in: path
          description: ID del producto al cual se dará acceso
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Grant access to product_Response_201'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostV3PublicProductsProduct_idAccessRequestBadRequestError
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PostV3PublicProductsProduct_idAccessRequestNotFoundError
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: integer
              required:
                - user_id
servers:
  - url: https://api.wisboo.com
components:
  schemas:
    Grant access to product_Response_201:
      type: object
      properties:
        id:
          type: integer
      required:
        - id
      title: Grant access to product_Response_201
    V3PublicProductsProductIdAccessPostResponsesContentApplicationJsonSchemaDetails:
      type: object
      properties:
        field:
          type: string
        explanation:
          type: string
      required:
        - field
        - explanation
      title: >-
        V3PublicProductsProductIdAccessPostResponsesContentApplicationJsonSchemaDetails
    PostV3PublicProductsProduct_idAccessRequestBadRequestError:
      type: object
      properties:
        code:
          type: string
        type:
          type: string
        details:
          $ref: >-
            #/components/schemas/V3PublicProductsProductIdAccessPostResponsesContentApplicationJsonSchemaDetails
        message:
          type: string
        timestamp:
          type: string
          format: date-time
        request_id:
          type: string
          format: uuid
      required:
        - code
        - type
        - details
        - message
        - timestamp
        - request_id
      title: PostV3PublicProductsProduct_idAccessRequestBadRequestError
    PostV3PublicProductsProduct_idAccessRequestNotFoundError:
      type: object
      properties:
        type:
          type: string
        timestamp:
          type: string
          format: date-time
        request_id:
          type: string
          format: uuid
      required:
        - type
        - timestamp
        - request_id
      title: PostV3PublicProductsProduct_idAccessRequestNotFoundError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python Grant access to product_example
import requests

url = "https://api.wisboo.com/v3/public/products/:product_id/access"

payload = { "user_id": 3746 }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Grant access to product_example
const url = 'https://api.wisboo.com/v3/public/products/:product_id/access';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"user_id":3746}'
};

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

```go Grant access to product_example
package main

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

func main() {

	url := "https://api.wisboo.com/v3/public/products/:product_id/access"

	payload := strings.NewReader("{\n  \"user_id\": 3746\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Grant access to product_example
require 'uri'
require 'net/http'

url = URI("https://api.wisboo.com/v3/public/products/:product_id/access")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"user_id\": 3746\n}"

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

```java Grant access to product_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.wisboo.com/v3/public/products/:product_id/access")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"user_id\": 3746\n}")
  .asString();
```

```php Grant access to product_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.wisboo.com/v3/public/products/:product_id/access', [
  'body' => '{
  "user_id": 3746
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Grant access to product_example
using RestSharp;

var client = new RestClient("https://api.wisboo.com/v3/public/products/:product_id/access");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"user_id\": 3746\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Grant access to product_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["user_id": 3746] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.wisboo.com/v3/public/products/:product_id/access")! 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()
```