Petnow LogoPetnow

Issue a hosted session

Issue a hosted session and get the web URL for the end user (Server Integration). Give `url` to the end user, for example by SMS, in a webview, or as a QR code. Store `id`: you need it to poll the session. When the end user finishes, the browser returns to `redirectUrl` with `petify_status` and, on `completed`, a one-time `petify_code`. Your server trades the code for the result with `GET /v2/hosted-results/{code}`. A failed session that the plan blocked carries `petify_code=FEATURE_UNAVAILABLE`.

POST
/v2/hosted-sessions

Authorization

VendorApiKeyAuth
x-petnow-api-key<token>

An API key from the Petify Console. A server key can call every route. A client (app) key can only create capture sessions and upload images.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.petify.petnow.io/v2/hosted-sessions" \  -H "Content-Type: application/json" \  -d '{    "action": "REGISTER",    "species": "DOG",    "redirectUrl": "https://vendor.example.com/petify/return",    "externalPetId": "customer-pet-42"  }'
{
  "success": true,
  "data": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "url": "string",
    "action": "REGISTER",
    "species": "DOG",
    "integrationMethod": "LINK_INTEGRATION",
    "bindingSource": "SERVER_ISSUED",
    "externalPetId": "string",
    "expiresAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "mock": true
  }
}

{
  "errors": [
    {
      "code": "PETNOWB2B10001",
      "details": {
        "externalPetId": [
          "This field is required for REGISTER."
        ]
      }
    }
  ]
}

{
  "errors": [
    {
      "code": "PETNOWB2B10000"
    }
  ]
}

{
  "errors": [
    {
      "code": "PETNOWB2B10005"
    }
  ]
}

{
  "errors": [
    {
      "code": "PETNOWB2B10010"
    }
  ]
}

{
  "errors": [
    {
      "code": "PETNOWB2B21002"
    }
  ]
}
{
  "errors": [
    {
      "code": "PETNOWB2B21001"
    }
  ]
}
{
  "errors": [
    {
      "code": "PETNOWB2B21007"
    }
  ]
}