I am trying to stitch two clips with AWS Elastic Transcoder CLI, but I am getting error.
My command : aws elastictranscoder create-job --pipeline-id 158182938949-p2e73l --inputs Key=movie1.mp4,movie2.mp4 --outputs Key=complete-mov.mp4,PresetId=159474848914704-fupili,Watermarks=[{PresetWatermarkId=TopLeft,InputKey=Untitled-4png.png}]
I am getting this error :
Parameter validation failed:
Invalid type for parameter Inputs[0].Key, value: ['MEYD-001.mp4', 'intro.mp4'], type: <class 'list'>, valid types: <class 'str'>
How can I ADD Multiple inputs[videos] in AWS Elastic transcoder CLI ?
AWS docs is lacking this.
Best Regards.
#akamai - i was wrong. ET does allow you to stitch clips in a single operation. I think your issue is your using the shortcut syntax and not passing a JSON array.
Try updating your command from
Key=movie1.mp4,movie2.mp4
to
'[{"Key"="movie1.mp4"},{"Key"="movie2.mp4"}]'
You may need some additional parameters to get the desired result. You can use the AWS command to generate a template to guide you like this: aws elastictranscoder create-job --generate-cli-skeleton. That will output a JSON string with every available property of the command. If you look at the Inputs section below, its defined as an array: "Inputs": [.
myname#mypc:~$ aws elastictranscoder create-job --generate-cli-skeleton
{
"PipelineId": "",
"Input": {
"Key": "",
"FrameRate": "",
"Resolution": "",
"AspectRatio": "",
"Interlaced": "",
"Container": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
},
"TimeSpan": {
"StartTime": "",
"Duration": ""
},
"InputCaptions": {
"MergePolicy": "",
"CaptionSources": [
{
"Key": "",
"Language": "",
"TimeOffset": "",
"Label": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"DetectedProperties": {
"Width": 0,
"Height": 0,
"FrameRate": "",
"FileSize": 0,
"DurationMillis": 0
}
},
"Inputs": [
{
"Key": "",
"FrameRate": "",
"Resolution": "",
"AspectRatio": "",
"Interlaced": "",
"Container": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
},
"TimeSpan": {
"StartTime": "",
"Duration": ""
},
"InputCaptions": {
"MergePolicy": "",
"CaptionSources": [
{
"Key": "",
"Language": "",
"TimeOffset": "",
"Label": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"DetectedProperties": {
"Width": 0,
"Height": 0,
"FrameRate": "",
"FileSize": 0,
"DurationMillis": 0
}
}
],
"Output": {
"Key": "",
"ThumbnailPattern": "",
"ThumbnailEncryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
},
"Rotate": "",
"PresetId": "",
"SegmentDuration": "",
"Watermarks": [
{
"PresetWatermarkId": "",
"InputKey": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"AlbumArt": {
"MergePolicy": "",
"Artwork": [
{
"InputKey": "",
"MaxWidth": "",
"MaxHeight": "",
"SizingPolicy": "",
"PaddingPolicy": "",
"AlbumArtFormat": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"Composition": [
{
"TimeSpan": {
"StartTime": "",
"Duration": ""
}
}
],
"Captions": {
"MergePolicy": "",
"CaptionSources": [
{
"Key": "",
"Language": "",
"TimeOffset": "",
"Label": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"CaptionFormats": [
{
"Format": "",
"Pattern": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
},
"Outputs": [
{
"Key": "",
"ThumbnailPattern": "",
"ThumbnailEncryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
},
"Rotate": "",
"PresetId": "",
"SegmentDuration": "",
"Watermarks": [
{
"PresetWatermarkId": "",
"InputKey": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"AlbumArt": {
"MergePolicy": "",
"Artwork": [
{
"InputKey": "",
"MaxWidth": "",
"MaxHeight": "",
"SizingPolicy": "",
"PaddingPolicy": "",
"AlbumArtFormat": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"Composition": [
{
"TimeSpan": {
"StartTime": "",
"Duration": ""
}
}
],
"Captions": {
"MergePolicy": "",
"CaptionSources": [
{
"Key": "",
"Language": "",
"TimeOffset": "",
"Label": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"CaptionFormats": [
{
"Format": "",
"Pattern": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"OutputKeyPrefix": "",
"Playlists": [
{
"Name": "",
"Format": "",
"OutputKeys": [
""
],
"HlsContentProtection": {
"Method": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": "",
"LicenseAcquisitionUrl": "",
"KeyStoragePolicy": ""
},
"PlayReadyDrm": {
"Format": "",
"Key": "",
"KeyMd5": "",
"KeyId": "",
"InitializationVector": "",
"LicenseAcquisitionUrl": ""
}
}
],
"UserMetadata": {
"KeyName": ""
}
}
Related
I am trying to deploy a CloudFormation template and get the following error:
(It is a YAML file)
Resource handler returned message: "Model validation failed (#/ContainerDefinitions: expected type: JSONArray, found: String)" (RequestToken: d23861e3-70c3-2777-96ce-18b46a118437, HandlerErrorCode: InvalidRequest)
I had to remove some values from the code below, but apart from that its the same layout.
ECSTaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
ContainerDefinitions: !Sub |
[
{
"name": "web",
"image": "xxxxxxxxxxxxxxxxxxxxx:latest",
"portMappings": [
{
"containerPort": 80,
"hostPort": 80,
"protocol": "tcp"
}
],
"environment": [
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
}
],
"ulimits": [
{
"name": "nofile",
"softLimit": 65536,
"hardLimit": 65536
}
],
"volumesFrom": [],
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
"options": {
"awslogs-group": "/ecs/web",
"awslogs-region": "eu-west-2",
"awslogs-stream-prefix": "ecs"
}
}
}
]
The pipe in your container definition will enforce a string in yaml. This is the line with the issue.
ContainerDefinitions: !Sub |
follow the documentation https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html
I am trying to stitch two clips with AWS Elastic Transcoder CLI, but I am getting error.
My command : aws elastictranscoder create-job --pipeline-id 158182938949-p2e73l --inputs Key=movie1.mp4,movie2.mp4 --outputs Key=complete-mov.mp4,PresetId=159474848914704-fupili,Watermarks=[{PresetWatermarkId=TopLeft,InputKey=Untitled-4png.png}]
I am getting this error :
Parameter validation failed:
Invalid type for parameter Inputs[0].Key, value: ['MEYD-001.mp4', 'intro.mp4'], type: <class 'list'>, valid types: <class 'str'>
How can I ADD Multiple inputs[videos] in AWS Elastic transcoder CLI ?
AWS docs is lacking this.
Best Regards.
#akamai - i was wrong. ET does allow you to stitch clips in a single operation. I think your issue is your using the shortcut syntax and not passing a JSON array.
Try updating your command from
Key=movie1.mp4,movie2.mp4
to
'[{"Key"="movie1.mp4"},{"Key"="movie2.mp4"}]'
You may need some additional parameters to get the desired result. You can use the AWS command to generate a template to guide you like this: aws elastictranscoder create-job --generate-cli-skeleton. That will output a JSON string with every available property of the command. If you look at the Inputs section below, its defined as an array: "Inputs": [.
myname#mypc:~$ aws elastictranscoder create-job --generate-cli-skeleton
{
"PipelineId": "",
"Input": {
"Key": "",
"FrameRate": "",
"Resolution": "",
"AspectRatio": "",
"Interlaced": "",
"Container": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
},
"TimeSpan": {
"StartTime": "",
"Duration": ""
},
"InputCaptions": {
"MergePolicy": "",
"CaptionSources": [
{
"Key": "",
"Language": "",
"TimeOffset": "",
"Label": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"DetectedProperties": {
"Width": 0,
"Height": 0,
"FrameRate": "",
"FileSize": 0,
"DurationMillis": 0
}
},
"Inputs": [
{
"Key": "",
"FrameRate": "",
"Resolution": "",
"AspectRatio": "",
"Interlaced": "",
"Container": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
},
"TimeSpan": {
"StartTime": "",
"Duration": ""
},
"InputCaptions": {
"MergePolicy": "",
"CaptionSources": [
{
"Key": "",
"Language": "",
"TimeOffset": "",
"Label": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"DetectedProperties": {
"Width": 0,
"Height": 0,
"FrameRate": "",
"FileSize": 0,
"DurationMillis": 0
}
}
],
"Output": {
"Key": "",
"ThumbnailPattern": "",
"ThumbnailEncryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
},
"Rotate": "",
"PresetId": "",
"SegmentDuration": "",
"Watermarks": [
{
"PresetWatermarkId": "",
"InputKey": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"AlbumArt": {
"MergePolicy": "",
"Artwork": [
{
"InputKey": "",
"MaxWidth": "",
"MaxHeight": "",
"SizingPolicy": "",
"PaddingPolicy": "",
"AlbumArtFormat": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"Composition": [
{
"TimeSpan": {
"StartTime": "",
"Duration": ""
}
}
],
"Captions": {
"MergePolicy": "",
"CaptionSources": [
{
"Key": "",
"Language": "",
"TimeOffset": "",
"Label": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"CaptionFormats": [
{
"Format": "",
"Pattern": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
},
"Outputs": [
{
"Key": "",
"ThumbnailPattern": "",
"ThumbnailEncryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
},
"Rotate": "",
"PresetId": "",
"SegmentDuration": "",
"Watermarks": [
{
"PresetWatermarkId": "",
"InputKey": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"AlbumArt": {
"MergePolicy": "",
"Artwork": [
{
"InputKey": "",
"MaxWidth": "",
"MaxHeight": "",
"SizingPolicy": "",
"PaddingPolicy": "",
"AlbumArtFormat": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"Composition": [
{
"TimeSpan": {
"StartTime": "",
"Duration": ""
}
}
],
"Captions": {
"MergePolicy": "",
"CaptionSources": [
{
"Key": "",
"Language": "",
"TimeOffset": "",
"Label": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"CaptionFormats": [
{
"Format": "",
"Pattern": "",
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
]
},
"Encryption": {
"Mode": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": ""
}
}
],
"OutputKeyPrefix": "",
"Playlists": [
{
"Name": "",
"Format": "",
"OutputKeys": [
""
],
"HlsContentProtection": {
"Method": "",
"Key": "",
"KeyMd5": "",
"InitializationVector": "",
"LicenseAcquisitionUrl": "",
"KeyStoragePolicy": ""
},
"PlayReadyDrm": {
"Format": "",
"Key": "",
"KeyMd5": "",
"KeyId": "",
"InitializationVector": "",
"LicenseAcquisitionUrl": ""
}
}
],
"UserMetadata": {
"KeyName": ""
}
}
I am trying to create a new customer using prestashop webservice on Postman. I already update webservice to accept json format for both input&output. When i try to create a new customer, there is a row added to database but the associations group id is not added.
I get the blank resource by http://mywebsite.com/api/customers?schema=synopsis and here what i get:
{
"customer": {
"id_default_group": "",
"id_lang": "",
"newsletter_date_add": "",
"ip_registration_newsletter": "",
"last_passwd_gen": "",
"secure_key": "",
"deleted": "",
"passwd": "",
"lastname": "",
"firstname": "",
"email": "",
"id_gender": "",
"birthday": "",
"newsletter": "",
"optin": "",
"website": "",
"company": "",
"siret": "",
"ape": "",
"outstanding_allow_amount": "",
"show_public_prices": "",
"id_risk": "",
"max_payment_days": "",
"active": "",
"note": "",
"is_guest": "",
"id_shop": "",
"id_shop_group": "",
"date_add": "",
"date_upd": "",
"reset_password_token": "",
"reset_password_validity": "",
"associations": {
"groups": [
{
"id": null
}
]
}
}
}
and here is how i fill out the form:
{
"customer": {
"id_default_group": "3",
"id_lang": "1",
"newsletter_date_add": "0000-00-00 00:00:00",
"ip_registration_newsletter": "",
"last_passwd_gen": "",
"secure_key": "",
"deleted": "0",
"passwd": "20101998",
"lastname": "sign up",
"firstname": "test",
"email": "asdfgh#gmail.com",
"id_gender": "2",
"birthday": "0000-00-00",
"newsletter": "0",
"optin": "0",
"website": "",
"company": "",
"siret": "",
"ape": "",
"outstanding_allow_amount": "0.000000",
"show_public_prices": "0",
"id_risk": "0",
"max_payment_days": "0",
"active": "1",
"note": "",
"is_guest": "0",
"id_shop": "1",
"id_shop_group": "1",
"date_add": "",
"date_upd": "",
"reset_password_token": "",
"reset_password_validity": "0000-00-00 00:00:00",
"associations": {
"groups": [
{
"id": "3"
}
]
}
}
}
and here is the result:
{
"customers": [
{
"id": "41",
"id_default_group": 3,
"id_lang": "1",
"newsletter_date_add": "0000-00-00 00:00:00",
"ip_registration_newsletter": "",
"last_passwd_gen": "2019-11-08 09:24:55",
"secure_key": "c8aa63435abbd3282b22080c903091e4",
"deleted": "0",
"passwd": "$2y$10$mt4u0xuPadIRVsV267Ao8uTGEPU.vixzNMRAfX5P.WY2OJClpBHsW",
"lastname": "sign up",
"firstname": "test",
"email": "asdfgh#gmail.com",
"id_gender": "2",
"birthday": "0000-00-00",
"newsletter": "0",
"optin": "0",
"website": "",
"company": "",
"siret": "",
"ape": "",
"outstanding_allow_amount": "0.000000",
"show_public_prices": "0",
"id_risk": "0",
"max_payment_days": "0",
"active": "1",
"note": "",
"is_guest": "0",
"id_shop": "1",
"id_shop_group": "1",
"date_add": "2019-11-08 15:24:55",
"date_upd": "2019-11-08 15:24:55",
"reset_password_token": "",
"reset_password_validity": "0000-00-00 00:00:00"
}
]
}
You can see that no association return.
Could anyone tell me what I was wrong? I'm quite new to prestashop. Thanks in advance
Is it possible to make partial refund using Authorize.Net? E.g. I have a transaction by 300$. First time I need to make a refund 100$ on this transaction. And second time to make a refund 50$.
What kind of transaction status will be after that?
first request:
...
"refId": "123456",
"transactionRequest": {
"transactionType": "refundTransaction",
"amount": "100.00",}
"refTransId": "1234567890"
}
...
second request:
...
"refId": "123456",
"transactionRequest": {
"transactionType": "refundTransaction",
"amount": "50.00",}
"refTransId": "1234567890"
}
...
Yes, you can make multiple refunds against one transaction as long as you do not go over the original transaction amount.
Below I made a $50 payment and then following up with a $20 and $10 refund. Both were successful.
Here is my original AUTH_CAPTURE request:
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "",
"transactionKey": ""
},
"refId": 38947161,
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": 100,
"payment": {
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "122020",
"cardCode": "999"
}
},
"order": {
"invoiceNumber": "1324567890",
"description": "this is a test transaction"
},
"lineItems": {
"lineItem": [
{
"itemId": "1",
"name": "vase",
"description": "Cannes logo",
"quantity": "18",
"unitPrice": "45.00"
},
{
"itemId": "2",
"name": "desk",
"description": "Big Desk",
"quantity": "10",
"unitPrice": "85.00"
}
]
},
"tax": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"duty": {
"amount": "8.55",
"name": "duty name",
"description": "duty description"
},
"shipping": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"poNumber": "456654",
"customer": {
"id": "18",
"email": "someone#blackhole.tv"
},
"billTo": {
"firstName": "Ellen",
"lastName": "Johnson",
"company": "Souveniropolis",
"address": "14 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"shipTo": {
"firstName": "China",
"lastName": "Bayles",
"company": "Thyme for Tea",
"address": "12 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"customerIP": "192.168.1.1",
"transactionSettings": {
"setting": [
{
"settingName": "allowPartialAuth",
"settingValue": "false"
},
{
"settingName": "duplicateWindow",
"settingValue": "0"
},
{
"settingName": "emailCustomer",
"settingValue": "false"
},
{
"settingName": "recurringBilling",
"settingValue": "false"
},
{
"settingName": "testRequest",
"settingValue": "false"
}
]
},
"userFields": {
"userField": {
"name": "favorite_color",
"value": "blue"
}
}
}
}
}
Here is my original AUTH_CAPTURE response:
{
"transactionResponse": {
"responseCode": "1",
"authCode": "TTJ26B",
"avsResultCode": "Y",
"cvvResultCode": "P",
"cavvResultCode": "2",
"transId": "40032153203",
"refTransID": "",
"transHash": "",
"testRequest": "0",
"accountNumber": "XXXX1111",
"accountType": "Visa",
"messages": [
{
"code": "1",
"description": "This transaction has been approved."
}
],
"userFields": [
{
"name": "favorite_color",
"value": "blue"
}
],
"transHashSha2": "0C9E5A47F93CD5B770A6B4AB24FE0F0D6F3B909066C72A10C4746F48C9886527A18B654736AE8D920D9048A14F2823A0DEC5B5F775A1C48DE9CBCF41C8D28CA3",
"SupplementalDataQualificationIndicator": 0
},
"refId": "38947161",
"messages": {
"resultCode": "Ok",
"message": [
{
"code": "I00001",
"text": "Successful."
}
]
}
}
Here is my first REFUND request (successful):
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "",
"transactionKey": ""
},
"refId": 30777668,
"transactionRequest": {
"transactionType": "refundTransaction",
"amount": 20,
"payment": {
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "122020"
}
},
"authCode": "40032153203"
}
}
}
Here is my first REFUND response (successful):
{
"transactionResponse": {
"responseCode": "1",
"authCode": "",
"avsResultCode": "P",
"cvvResultCode": "",
"cavvResultCode": "",
"transId": "40032153314",
"refTransID": "",
"transHash": "",
"testRequest": "0",
"accountNumber": "XXXX1111",
"accountType": "Visa",
"messages": [
{
"code": "1",
"description": "This transaction has been approved."
}
],
"transHashSha2": "4CE2D83B56C09494AD5609440E3337A6DEE0F4C74FBC99B218D65F6A121EFFC269F8954AC47C17B3B739E61A860C7B0818A8497D85D314D6E0CD89C9FE71A071",
"SupplementalDataQualificationIndicator": 0
},
"refId": "30777668",
"messages": {
"resultCode": "Ok",
"message": [
{
"code": "I00001",
"text": "Successful."
}
]
}
}
Here is my second REFUND request (successful):
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "",
"transactionKey": ""
},
"refId": 40597686,
"transactionRequest": {
"transactionType": "refundTransaction",
"amount": 10,
"payment": {
"creditCard": {
"cardNumber": "4111111111111111",
"expirationDate": "122020"
}
},
"authCode": "40032153203"
}
}
}
Here is my second REFUND response (successful):
{
"transactionResponse": {
"responseCode": "1",
"authCode": "",
"avsResultCode": "P",
"cvvResultCode": "",
"cavvResultCode": "",
"transId": "40032153319",
"refTransID": "",
"transHash": "",
"testRequest": "0",
"accountNumber": "XXXX1111",
"accountType": "Visa",
"messages": [
{
"code": "1",
"description": "This transaction has been approved."
}
],
"transHashSha2": "FD146FC0F8F3F31068905EC6C8D252662AA735ACDFAC53B4A8D808060C244C06288700AA8872466C3E240B62130D010CFBDE0473D09B631514A6E2E2CB77804F",
"SupplementalDataQualificationIndicator": 0
},
"refId": "40597686",
"messages": {
"resultCode": "Ok",
"message": [
{
"code": "I00001",
"text": "Successful."
}
]
}
}
I have a post man request. Which returns a response data as:
[
{
"id": "7ca27c09-2b67-417e-b367-f97d49824a2f",
"tags": [],
"type": "ApplicationProfile",
"userId": "2f2c8684-874d-49ea-bfa4-977069c1e3e2",
"profile": {
"User-Profile": {
"PHI": {
"gender": "Male",
"surgeryDate": {
"value": "2017-06-06"
},
"surgeryType": {
"value": "gastricBand"
},
"heightInches": "72",
"approvalPhase": "2",
"profileImageUrl": "",
"motivationalImageUrl": ""
},
"PII": {
"mail": "c11#c111.com",
"lastName": "",
"firstName": "name1",
"shouldReceiveNotifications": true
}
},
"motivationalGoals": [
{
"goal": "Improving health",
"goalId": "2957"
},
{
"goal": "Relieving pain",
"goalId": "2958"
},
{
"goal": "Feeling better",
"goalId": "2960"
}
]
},
"version": 35,
"createdBy": "2f2c8684-874d-49ea-bfa4-977069c1e3e2",
"lastModifiedBy": "2f2c8684-874d-49ea-bfa4-977069c1e3e2",
"applicationName": "Health Partner",
"createdDateTime": "2017-06-08T16:08:32.497Z",
"lastModifiedDateTime": "2017-06-09T13:23:03.503Z"
},
{
"id": "091b5ebd-b096-436e-a703-f97f0ae77baf",
"tags": [
"Application-Profile"
],
"type": "ApplicationProfile",
"userId": "2f2c8684-874d-49ea-bfa4-977069c1e3e2",
"profile": {
"User-Profile": {
"PHI": {
"gender": "",
"surgeryDate": {
"value": "2017-06-01"
},
"surgeryType": {
"value": ""
},
"heightInches": "72",
"approvalPhase": "2",
"profileImageUrl": "",
"motivationalImageUrl": ""
},
"PII": {
"mail": "c11#c111.com",
"lastName": "Dev",
"firstName": "Kat",
"shouldReceiveNotifications": true
}
},
"motivationalGoals": [
{
"goal": "Improving health",
"goalId": "2957"
},
{
"goal": "Relieving pain",
"goalId": "2958"
},
{
"goal": "Feeling better",
"goalId": "2960"
}
]
},
"version": 41,
"createdBy": "2f2c8684-874d-49ea-bfa4-977069c1e3e2",
"lastModifiedBy": "2f2c8684-874d-49ea-bfa4-977069c1e3e2",
"applicationName": "Health Partner Weightloss",
"createdDateTime": "2017-06-03T16:19:57.811Z",
"lastModifiedDateTime": "2017-06-08T16:07:49.555Z"
}
]
I need to extract the value of the emailid and set as global variable.
here is my code:
var jsonData1 = JSON.parse(responseBody);
postman.setGlobalVariable("jsonData1",jsonData1.profile.User-Profile.PII.mail);
But I am getting error. "User is undefined".
The problem here is that the hyphen / minus sign is interpreted as the subtraction operator.
Consider changing your API and using "userProfile" instead of "User-Profile".