Upload product images (POST)
Scenario

How does this work
REST API
Function
provider: DATA_PROVIDER_REST
# Creates data in the backend.
method: POST
# Use your REST service URL.
url: https://jigx-training.azurewebsites.net/api/images
# Direct the function call to use local execution between the mobile device
# and the REST service.
useLocalCall: true
parameters:
accessToken:
location: header
required: true
type: string
# Use manage.jigx.com to define credentials for your solution.
value: service.oauth
custId:
type: string
location: body
required: false
createdBy:
type: string
location: body
required: false
description:
type: string
location: body
required: false
createdDate:
type: string
location: body
required: false
value: =$now()
image:
type: image
location: body
required: false
# Define the image metadata that must be created in the record in the REST API.
inputTransform: |
{
"custId": custId,
"createdBy": createdBy,
"description": description,
"createdDate": createdDate,
"image": image
}
# Specifiying an outputTransform for the image_id ensure that the id created
# by the REST API is automatically synced back to the Jigx local datasource
# replacing the temp_id.
outputTransform: |
$.{
"id": image_id
}
# Convert the images to be uploaded to the REST service to base64
# which the REST service expects to be able to store the image.
conversions:
- property: image
from: local-uri
to: base64Action (global)
Jig (screen)
Index
Last updated
Was this helpful?