Update Account (PUT) Endpoint in new Yodlee API for MFA - yodlee

Background
I am using the newer Yodlee Aggregation API that differs from what I was previously building off of.
I am currently using this endpoint in the account registration flow to put the MFA response:
PUT /{cobrandName}/v1/providers/{providerAccountId}
My request looks like this:
{
url: `${this.rest}providers/${providerAccountId}`,
headers: {
'Authorization': `cobSession=${self.appToken}, userSession=${token}`
},
form: {
'MFAChallenge': JSON.stringify(newMfa)
}
}
where this.rest is my personal rest url, providerAccountId is the appropriate providerAccountId for the refresh, self.appToken is the current cobrand session token, token is the current user's login token, and newMfa is a JSON object being stringified that matches this profile:
{
"loginForm": {
"mfaTimeout": 94650,
"formType": "questionAndAnswer",
"row": [
{
"id": "SQandA--QUESTION_1--Row--1",
"fieldRowChoice": "0001",
"form": "0001",
"label": "What is the name of your state?",
"field": [
{
"id": "SQandA_QUESTION_1_1",
"name": "QUESTION_1",
"isOptional": false,
"value": "Enter the answer",
"valueEditable": true,
"type": "text"
}
]
},
{
"id": "SQandA--QUESTION_2--Row--2",
"fieldRowChoice": "0001",
"form": "0001",
"label": "What is the name of your first school",
"field": [
{
"id": "SQandA_QUESTION_2_2",
"name": "QUESTION_2",
"isOptional": false,
"value": "Enter the answer",
"valueEditable": true,
"type": "text"
}
]
}
]
}
with the exeption being the value fields of the field object, which have been encrypted with PKI as per instructions.
Issue
However, when I carry out this PUT request, I get this error from Yodlee:
{ errorCode: 'Y803',
errorMessage: 'MFAChallenge or providerParam required',
referenceCode: 'p1460412835654A4Q24t' }
though I clearly have an MFAChallenge parameter in my form. Any ideas on why I could be getting this error if the MFAChallenge is present (and note that it is the only info that is passed through the PUT request other than through headers or url parameters)? I tried putting it through as body data, but that doesn't seem to work, and very few of the API endpoints actually seem to use body over form encoded strings, though there was at least one.

You have to send this information MFAChallenge as part of URL, see below example
https://developer.api.yodlee.com/ysl/restserver/v1/providers/10114184?MFAChallenge=%7B%20%22loginForm%22%3A%20%7B%20%20%20%20%20%22mfaTimeout%22%3A%2094650%2C%20%20%20%20%20%22formType%22%3A%20%22questionAndAnswer%22%2C%20%20%20%20%20%22row%22%3A%20%5B%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22SQandA--QUESTION_1--Row--1%22%2C%20%20%20%20%20%20%20%20%20%22fieldRowChoice%22%3A%20%220001%22%2C%20%20%20%20%20%20%20%20%20%22form%22%3A%20%220001%22%2C%20%20%20%20%20%20%20%20%20%22label%22%3A%20%22What%20is%20the%20name%20of%20your%20state%3F%22%2C%20%20%20%20%20%20%20%20%20%22field%22%3A%20%5B%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22SQandA_QUESTION_1_1%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22QUESTION_1%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22isOptional%22%3A%20false%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22value%22%3A%20%22Enter%20the%20answer%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22valueEditable%22%3A%20true%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%20%20%20%20%20%20%20%20%5D%20%20%20%20%20%7D%2C%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22SQandA--QUESTION_2--Row--2%22%2C%20%20%20%20%20%20%20%20%20%22fieldRowChoice%22%3A%20%220001%22%2C%20%20%20%20%20%20%20%20%20%22form%22%3A%20%220001%22%2C%20%20%20%20%20%20%20%20%20%22label%22%3A%20%22What%20is%20the%20name%20of%20your%20first%20school%22%2C%20%20%20%20%20%20%20%20%20%22field%22%3A%20%5B%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22SQandA_QUESTION_2_2%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22QUESTION_2%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22isOptional%22%3A%20false%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22value%22%3A%20%22Enter%20the%20answer%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22valueEditable%22%3A%20true%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%20%20%20%20%20%20%20%20%5D%20%20%20%20%20%7D%20%5D%20%7D

Related

Facebook ads custom audience Data is missing or does not match schema error

i was building a integration with the facebook ads audience API, and according the documentation the request must be created like this:
POST - https://graph.facebook.com/v15.0/<MY_CUSTOM_AUDIENCE_ID>/users?access_token=<MY_ACCESS_TOKEN>
{
"session":{
"session_id":1,
"batch_seq":1,
"last_batch_flag":true,
"estimated_num_total":1
},
"payload":{
"schema":[
"FN"
],
"data":
[
"8b1ebea129cee0d2ca86be6706cd2dfcf79aaaea259fd0c311bdbf2a192be148"
]
}
}
Using the previus example a received a error 400:
{
"error": {
"message": "(#100) Data is missing or does not match schema",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "AqrLd9uIw0D4BBFtHF33bdU"
}
}
For do this i used this documentation https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences#hash
Anyone has use this before?
Your schema field type is array but array use form multi-key qualification.
Change it to string: schema: 'FN'
In docs you can see all formats.
This payload with multi keys work for me:
{
"session": {
"session_id": 123,
"batch_seq": 1,
"last_batch_flag": true
},
"payload": {
"schema": [
"EMAIL",
"PHONE",
"FN"
],
"data": [
["EMAIL_HASH", "PHONE_HASH", "FN_HASH"]
]
}
}

Forge - The category 'rfaFile' in '$(rfaFile)' is unrecognized

We are getting an error while executing a WorkItem in Forge's Design Automation API.
The error is this:
Error: The category 'rfaFile' in '$(rfaFile)' is unrecognized. Valid values are args, settings, appbundles, engine, engines.
And it happens right after the 'Start preparing script and command line parameters.' in the report.txt. We are not really sure why's this happening. It looks like the error is thrown in the activity. The activity looks like this:
function publishActivity() {
return $.ajax({
url: "/api/forge/design_automation/activities",
headers: {
"X-CSRF-Token": csrfToken,
"Forge-Token": forgeToken
},
method: "POST",
contentType: "application/json",
data: JSON.stringify({
activity: {
"id": "DeleteWallsActivity",
"commandLine": [ "$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[rfaFile].path)\" /al \"$(appbundles[TestAppId].path)\"" ],
"parameters": {
"rfaFile": {
"zip": false,
"ondemand": false,
"verb": "get",
"description": "Input Revit model",
"required": true,
"localName": "$(rfaFile)"
},
"result": {
"zip": false,
"ondemand": false,
"verb": "put",
"description": "Results",
"required": true,
"localName": "result.rfa"
},
"inputJson": {
"verb": "get",
"description": "input json",
"localName": "params.json",
"ondemand": false,
"required": false,
"zip": false
}
},
"engine": "Autodesk.Revit+2021",
"appbundles": [ "petar3db.TestAppId+test" ],
"description": "Deletes walls from Revit file."
}
})
}).done(function(data) {
console.log("Activity created");
bundleUploadData = data["uploadParameters"];
}).fail(function(jqXHR, textStatus) {
console.log("Failed to create activity", jqXHR.responseJSON);
console.log(jqXHR, textStatus);
});
}
and it looks like the "localName": "$(rfaFile)" is causing the trouble.
Let's take a look at our WorkItem code which we execute via websockets:
{
"headers": {
"Authorization" : "Bearer <token here>"
},
"action": "post-workitem",
"data": {
"activityId": "petar3db.DeleteWallsActivity+test",
"arguments": {
"rfaFile": {"url": "https://developer.api.autodesk.com/oss/v2/signedresources/da992c60-a3d7-469d-8c3e-d0f089e2e509?region=US", "pathInZip": "emptyfam.rfa"},
"result": {"verb": "put", "url": "https://developer.api.autodesk.com/oss/v2/signedresources/b78151c1-93aa-495f-96c8-183bca26e071?region=US"},
"inputJson": {"localName": "params.json", "url": "the url to the file"}
}
}
}
the really strange part is that this process worked just fine and started throwing this error when we added "inputJson" into the activity and workItem. (We want to send some JSON data to the AppBundle with the WorkItem)
What can be the issue? Are missing something?
As for "localName": "$(rfaFile)", to be noted that if the local name is defined like this, Design Automation will come up a valid name for this argument by its own logic. If you want to fully control the input file, such as accessing it in the addin(Appbundles)'s code, it is recommended to define a "real" localName instead, e.g. "localName": "input.rfa"
In your case above, you may need to:
Remove /i \"$(args[rfaFile].path)\" from commandLine in the Activity
Define "localName": "inputRFA", so the input will be downloaded, unzipped as a folder named as inputRFA. emptyfam.rfa should be under this folder.
Call OpenDocumentFile in the addin to open a Revit file, get document
Call document.LoadFamily(".\inputRFA\emptyfam.rfa", out family); in the adding to open/load rfa file. See this Revit API
There is a mismatch in parameter name in activity with the argument name in workitem. Correct way to post the workitem should be:
{
"headers": {
"Authorization" : "Bearer <token here>"
},
"action": "post-workitem",
"data": {
"activityId": "petar3db.DeleteWallsActivity+test",
"arguments": {
"rfaFile": {"url": "https://developer.api.autodesk.com/oss/v2/signedresources/da992c60-a3d7-469d-8c3e-d0f089e2e509?region=US", "pathInZip": "emptyfam.rfa"},
"result": {"verb": "put", "url": "https://developer.api.autodesk.com/oss/v2/signedresources/b78151c1-93aa-495f-96c8-183bca26e071?region=US"},
"inputJson": {"localName": "params.json", "url": "the url to the file"}
}
}
}
Change the argument field rvtFile to rfaFile.

Appstoreconnect Api user update

I can’t understand how to create the http body of the Modify User Account api:
PATCH
https://api.appstoreconnect.apple.com/v1/users/{id}
In particular the:
[UserUpdateRequest.Data.Relationships.VisibleApps.Data]
What are the required id and type properties of Data object? Could somebody provide a code or postman example of a request ?
This is the url of the topic:
Appstoreconnect Api - Update User
The PATCH request should look like this:
PATCH /v1/users/XXX
{
"data": {
"type": "users",
"id": "XXX",
"attributes": {
"allAppsVisible": false
},
"relationships": {
"visibleApps": {
"data": [
{"type": "apps", "id": "AAA"},
{"type": "apps", "id": "BBB"}
]
}
}
}
}
Where AAA and BBB are Apple IDs of your apps. You can find these on the App Information page, or in response to the /v1/apps API calls.

Add Account (POST) Endpoint No Longer Working in new Yodlee API

OVERVIEW
I am not sure what happened, as I have not touched my code that interacts with the Add Account endpoint in Yodlee (POST /{cobrandName}/v1/providers/{providerId}), but it has become broken (it was working as of Thursday). I am now getting this reply:
{ errorCode: 'Y400',
errorMessage: 'Null argument specified',
referenceCode: 'RB_134ae91e-4c80-4ad5-aac5-243ca428421d' }
DETAILS
I have the appropriate route params inserted into this POST /{cobrandName}/v1/providers/{providerId} and am passing a stringified JSON object as the request body (per the documentation) that looks like this:
{
"provider": [{
"id": 492,
"name": "Fidelity Investments",
"loginUrl": "https://login.fidelity.com/ftgw/Fas/Fidelity/RtlCust/Login/Init?AuthRedU",
"baseUrl": "http://www.fidelity.com/",
"favicon": "https://moneycenter.ydlstatic.com/fastlink/appscenter/siteImage.fastlink.do?access_type=APPS_CENTER_PRODUCTION&siteId=492&imageType=FAVICON",
"logo": "https://moneycenter.ydlstatic.com/fastlink/appscenter/siteImage.fastlink.do?access_type=APPS_CENTER_PRODUCTION&siteId=492&imageType=LOGO",
"status": "Supported",
"mfaType": "Multiple levels of strong authentication.",
"oAuthSite": false,
"lastModified": "2016-03-31T10:39:36Z",
"forgetPasswordUrl": "http://personal.fidelity.com/accounts/services/content/pinchange.shtml.tvsr",
"containerNames": ["tax", "investment"],
"loginForm": {
"id": 172,
"forgetPasswordURL": "http://personal.fidelity.com/accounts/services/content/pinchange.shtml.tvsr",
"formType": "login",
"row": [{
"id": 4140,
"label": "Username",
"form": "0001",
"fieldRowChoice": "0001",
"field": [{
"id": 358,
"name": "LOGIN",
"maxLength": 15,
"type": "text",
"value": "07ceb28fc8b71dc3e08126e0169022419c114e02cbca7fcfb2e11b939d805c898310d0741bcc0a76943227a38c02e66fd5a5fb132a3c0fb4c663102b9e0947c99953f15fa051ac95fdf9a3ee7d461d33ff11482a3cf973ccd3c2aba6d494deb6ddd1d0dfc89ee0bfa991bf24e19d07bd9f066bbde4fd74ed88f3808ab7420f1430b1ead362a32dd26d5b077f263c83469c37a3c8816b7eaa243f9f89dc4ad4e023642ba1aa651d4b371f613d37619279d90187d11bbd4404896d18605c028bd55461c6e11b47a8aad8ea93d483db7c1211728c9b1222a86811a106077ae5525c75f427520d52478e48f22f6ae11a21bcb42e772befa2e83570c4b4d7c3a54619",
"isOptional": false,
"valueEditable": true
}]
}, {
"id": 4139,
"label": "Password",
"form": "0001",
"fieldRowChoice": "0002",
"field": [{
"id": 357,
"name": "PASSWORD",
"maxLength": 20,
"type": "password",
"value": "285968df9ddf385b2da03d7247533dd0f7dbf6d951c0a6a92bad7701868d4941bcdfe7a41167f3bb0a47cb5ae22557444f83a641318c1985035c6e2c7e7e11a4e71ac52965ad26845ee64a13a2a61c07945870b7c009aba673e01b074fc047e9b08c20cbde0cb36a6068a9d07b4cad7a777f8f6654dd8436527d6017e3a81af68f1dbbfabc52a93a2f8423b342b243316248cebb549bed7433f77a90aae4a3c1c892a725872f77a369407741be98715b39039b547f735e92748ddd5d389c4de3082684c1f5f5b1917ceb34348010866ce6cb649d6e4dac4c45d85c4a729c67fb643c34e704278f3a15626bbe73cddf69cfe5df8bcdd5682415afe952585da800",
"isOptional": false,
"valueEditable": true
}]
}]
}
}]
}
The form values are encrypted via PKI as per the documentation, using the key provided by the appropriate API endpoint, and I have both a cobrand session token and a yodlee user session token in the authentication headers ('Authorization': 'cobSession={appToken}, userSession={token}'). I was previously receiving back the expected 'refresh info' response using the same exact structure and process. I'm trying to understand what the 'null argument' referenced in the error is.

Using the advanced query api and get all pages back

I can successfully call into an advanced query method and get the first page of data back (using the post option) refernced in http://api.docs.import.io/#QueryMethods
Anyone have an idea how to page after that? I get 20 out of 190 results. My query looks like:
var query = {
"input": { "last_name": name },
"additionalInput": {
"8d817939-my-api-key-9502ed72": cookie
},
"returnPaginationSuggestions": true
}
Where param name and cookie are known vars.
The results do not return a pagination block either as in the model result:
{
"connectorVersionGuid": "string",
"pagination": {
"pattern": "string",
"next": "string",
"currentPageNum": 0,
"previous": "string"
},
"connectorGuid": "string",
"totalResults": 0,
"errorType": "TimeoutException",
"outputProperties": [
{
"type": "STRING",
"name": "string"
}
],
"cookies": [
"string"
],
"results": [
{}
],
"pageUrl": "string",
"error": "string",
"data": {}
}
If the response is not returning the "Pagination" block, it means that the system was not able to identify pagination on a given page.
As far as I remember pagination is flaky for Extractor APIs, while it works quite well for Magic APIs. I would recommend trying to get a Magic extractor, and getting pagination suggestions for it. Than you should be able to get the "Pagination" block in your response, and use "next" value to get the URL of the next page.