Upload User Photos

Post


/api/2/UploadPhoto/UploadUserPhotos?websiteId={websiteId}&frontAppUserId={frontAppUserId}&webApiClientKey={webApiClientKey}&dpi={dpi}&isGuest={isGuest}&oldExternalUserId={oldExternalUserId}


The Upload User Photos API is used to upload user photos/images to the system. 

The uploaded photo/images are processed, and metadata such as image name, dimensions, and DPI are returned.

Request Information

Parameters

Parameter Name

Description

WebsiteId (Int)

This param refers to the website associated with customized products.

The admin user of Artifi can create one or more websites and assign products to each of them. The ID of the website with which specified customized products are associated should be specified in this parameter.

frontAppUserId (String)

This is the ID of your e-commerce website's user. The user can be registered or be a guest user.

If the user is registered, the user id is passed in this parameter and if the user is not registered with the e-commerce website, a temporary id has to be created for the user and that id is passed in this parameter. 

The non-registered users are called as guest users.

WebApiClientKey (String)

When any company registers with Artifi, Artifi will generate a special and unique key for that company, which will be called the client key.

This client key can be found in the registered company's profile tab in the Artifi Account.

The client key will be used for client (company) authentication and will be referred to as WebApiClientKey.

dpi (Int)

This parameter states the Output image DPI value of the output image. If no value is passed, the default value 72 DPI is considered.

isGuest (Boolean)

This parameter refers to the current status of the user whether the user is registered or a guest.

This is the unregistered user who has access to Artifi for customization.

oldExternalUserId (String)

This optional parameter can be used if the user was previously registered externally.

External ID for previously registered users from other systems.

Response Information

Response body formats

On Success

On success, this method will call back the JavaScript method in the website which is specified in the "successCallback" parameter with success Message.

Success Message:

{

    "Response": "Success",

    "Message": null,

    "Data": {

        "Id": 5101329,

        "ImageName": "06ca3ca2-c5a9-4e5e-b413-3fea068145a5",

        "UniqueImageName": "fcdd3441-bd4d-4022-91c3-d9143521fd68",

        "Width": 1330,

        "Height": 1473,

        "DPI": 72,

        "Extension": ".jpg",

        "MimeType": "image/jpeg",

        "PhotoCode": "5101329"

    },

    "ErrorCode": null

}

On Error

On error, this method will call back the JavaScript method in the website which is specified in the "errorCallback" parameter with errorMessage.

Error Message:

{

  "Response": "Error",

  "Message": "Internal server error occurred , while processing image",

  "Data": null,

  "ErrorCode": "500"

}

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.