- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 05:53 PM
I try to post data from one PDI to another using powershell(the script is copyed from the rest api explore page).
1.I try to get data from one instance, the data return correctly.
2.Then I edit the record in returned json and use as the body for the post method to post to another instance.
3.when I run the powershell script, it returns 400 error code.
4. However when I run the post method seperately. It runs OK.
I have confirmed the body data format is exactly the same.
Anyone knows why this happens???
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 04:38 PM
hi guys, thanks for replying. I have found the mistake.(I modified the script lightly.)
As I use a rest api to get some records from one instance and want to user import set rest api to post the other.
so I have to loop the records as a string and then convert the string record to json to use as a body.
so I add the "$body1 = $item | convertto-json" sentence. The result runs OK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 04:38 PM
hi guys, thanks for replying. I have found the mistake.(I modified the script lightly.)
As I use a rest api to get some records from one instance and want to user import set rest api to post the other.
so I have to loop the records as a string and then convert the string record to json to use as a body.
so I add the "$body1 = $item | convertto-json" sentence. The result runs OK.