Yodlee REST API - addItemForContentService1 - yodlee

Could you please provide a JSON sample of how you would post an addItemForContentService1 for a bank with a FieldInfoMultiFixed field. An example is Sallie Mae, content service ID #3805
Thanks

I wrote this in python. Replace some of the values such as cobrand_session_token, content_service_id with the actual values:
Most of the below is directly from this documentation.
payload = {"cobSessionToken": cobrand_session_token, "userSessionToken": session["user_session_token"], "contentServiceId": content_service_id, "shareCredentialsWithinSite": True, "startRefreshItemOnAddition": True, "credentialFields.enclosedType": "com.yodlee.common.FieldInfoMultiFixed",\
"credentialFields[0].valueIdentifier":"LOGIN",\
"credentialFields[0].displayName":"UserID",\
"credentialFields[0].isEditable":True,\
"credentialFields[0].isEscaped":False,\
"credentialFields[0].name":"LOGIN",\
"credentialFields[0].helpText":5112,\
"credentialFields[0].fieldType":"TEXT",\
"credentialFields[0].valueMask":"LOGIN_FIELD",\
"credentialFields[0].maxlength":40,\
"credentialFields[0].size":20,\
"credentialFields[1].valueIdentifier":"PASSWORD",\
"credentialFields[1].displayName":"Password",\
"credentialFields[1].isEditable":True,\
"credentialFields[1].isEscaped":False,\
"credentialFields[1].name":"PASSWORD",\
"credentialFields[1].helpText":4530,\
"credentialFields[1].fieldType":"IF_PASSWORD",\
"credentialFields[1].valueMask":"LOGIN_FIELD",\
"credentialFields[1].maxlength":40,\
"credentialFields[1].size":20, "credentialFields[0].value":"content_account_username", "credentialFields[1].value":"content_account_password"}

Related

How to break string data coming from Api response in Laravel

This my data coming from Api : "TAX_BREAKUP": "ab=4835,ay=1400,at=852,cb=4835,cy=1400,ct=852"
#foreach(explode(',', $data['TAX_BREAKUP']) as $amt)
Adult Price₹ {{$amt}}
Tax{{$amt}}
#endforeach
An this is code which I am trying to break the string.
If I understand your question, what you want is :
$Tax_arr = explode(',', $data['TAX_BREAKUP']);
foreach($Tax_arr as $amt){
$amt_arr = explode('=', $amt);
echo $amt_arr[0]." is ".$amt_arr[1]."<br>";
}
$amt_arr[0] is the attribute name and $amt_arr[1] is the value

Not able to put tag column value on monday item

I am trying to use python to automation common Monday tasks. I am able to create an item in the board but the column (type=tag) is not updating.
I used this tutorial:
https://support.monday.com/hc/en-us/articles/360013483119-API-Quickstart-Tutorial-Python#
Here is my graphql code that I am executing:
query = 'mutation ($device: String!, $columnVals: JSON!) { create_item (board_id:<myboardid>, item_name:$device, column_values:$columnVals) { id } }'
vars = {'device': device,
'columnVals': json.dumps({
'cloud_name6': {'text': cloudname} # this is where i want to add a tag. cloud_name6 is id of the column.
})
}
data = {'query' : query, 'variables' : vars}
r = requests.post(url=apiUrl, json=data, headers=headers) print(r.json())
I have tried changing id to title as key in the Json string but no luck. I fetched the existing item and tried to add exact json string but still no luck. I also tried below json data without any luck
'columnVals': json.dumps({
'cloud_name6': cloudname
})
Any idea what's wrong with the query?
When creating or mutating tag columns via item queries, you need to send an array of ids of the tags ("tag_ids") that are relating to this item. You don't set or alter tag names via an item query.
Corrected Code
'columnVals': json.dumps({
'cloud_name6': {'tag_ids': [295026,295064]}
})
https://developer.monday.com/api-reference/docs/tags

How to get section heading of tables in wikipedia through API

How do I get section headings for individual tables: Xia dynasty (夏朝) (2070–1600 BC), Shang dynasty (商朝) (1600–1046 BC), Zhou dynasty (周朝) (1046–256 BC) etc. for the Chinese Monarchs list on Wikipedia via API? I use the code below to connect:
from pprint import pprint
import requests, wikitextparser
r = requests.get(
'https://en.wikipedia.org/w/api.php',
params={
'action': 'query',
'titles': 'List_of_Chinese_monarchs',
'prop': 'revisions',
'rvprop': 'content',
'format': 'json',
}
)
r.raise_for_status()
pages = r.json()['query']['pages']
body = next(iter(pages.values()))['revisions'][0]['*']
doc = wikitextparser.parse(body)
print(f'{len(doc.tables)} tables retrieved')
han = doc.tables[5].data()
doc.tables[6].data()
doc.tables[i].data() only return the table values, without its <h2> section headings. I would like the API to return me a list of title strings that correspond to each of the 83 tables returned.
Original website:
https://en.wikipedia.org/wiki/List_of_Chinese_monarchs
I'm not sure why you are using doc.tables when it is the sections you are interested in. This works for me:
for i in range(1,94,1):
print(doc.sections[i].title.replace('[[','').replace(']]',''))
I get 94 sections though rather than 83 and while you can use len(doc.sections) this will include See also etc. There must be a more elegant way of removing the wikilinks.

amadeus API list of all possible hotel "amenities"

In Amadeus hotels API there is amenities choices and in the search results there is different possibilities as well.
To make amenities more user readable I'd like a FULL list of ALL different possible amenities so that I can populate a database with amenities code and different translations.
For a client searching for hotels: stuff like ACC_BATHS, SAFE_DEP_BOX is kind of not readable friendly...
I'm referring to this
{
"data": [
{
"type": "hotel-offers",
"hotel": {
"type": "hotel",
"cityCode": "MIA",
...
"amenities": [
"HANDICAP_FAC",
"ACC_BATHS",
"ACC_WASHBASIN",
"ACC_BATH_CTRLS",
"ACC_LIGHT_
where can I find a csv of all amenities ?
I contacted the Amadeus tech support and they answered me this :
(you can copy this list, it's csv format... NAME_OF_AMENITY,amenity_code )
226 codes
PHOTOCOPIER,BUS.2
PRINTER,BUS.28
AUDIO-VIS_EQT,BUS.37
WHITE/BLACKBOARD,BUS.38
BUSINESS_CENTER,BUS.39
CELLULAR_PHONE_RENTAL,BUS.40
COMPUTER_RENTAL,BUS.41
EXECUTIVE_DESK,BUS.42
LCD/PROJECTOR,BUS.45
MEETING_ROOMS,BUS.46
OVERHEAD_PROJECTOR,BUS.48
SECRETARIAL_SERVICES,BUS.49
CONFERENCE_SUITE,BUS.94
CONVENTION_CTR,BUS.95
MEETING_FACILITIES,BUS.96
24_HOUR_FRONT_DESK,HAC.1
DISABLED_FACILITIES,HAC.101
MULTILINGUAL_STAFF,HAC.103
WEDDING_SERVICES,HAC.104
BANQUETING_FACILITIES,HAC.105
PORTER/BELLBOY,HAC.106
BEAUTY_PARLOUR,HAC.107
WOMENS_GST_RMS,HAC.110
PHARMACY,HAC.111
120_AC,HAC.113
120_DC,HAC.114
220_AC,HAC.115
220_DC,HAC.117
BARBECUE,HAC.118
BUTLER_SERVICE,HAC.136
CAR_RENTAL,HAC.15
CASINO,HAC.16
BAR,HAC.165
LOUNGE,HAC.165
TRANSPORTATION,HAC.172
WIFI,HAC.178
WIRELESS_CONNECTIVITY,HAC.179
BALLROOM,HAC.191
BUS_PARKING,HAC.192
CHILDRENS_PLAY_AREA,HAC.193
NURSERY,HAC.194
DISCO,HAC.195
24_HOUR_ROOM_SERVICE,HAC.2
COFFEE_SHOP,HAC.20
BAGGAGE_STORAGE,HAC.201
NO_KID_ALLOWED,HAC.217
KIDS_WELCOME,HAC.218
COURTESY_CAR,HAC.219
CONCIERGE,HAC.22
NO_PORN_FILMS,HAC.220
INT_HOTSPOTS,HAC.221
FREE_INTERNET,HAC.222
INTERNET_SERVICES,HAC.223
PETS_ALLOWED,HAC.224
FREE_BREAKFAST,HAC.227
CONFERENCE_FACILITIES,HAC.24
HI_INTERNET,HAC.259
EXCHANGE_FAC,HAC.26
LOBBY,HAC.276
DOCTOR_ON_CALL,HAC.28
24H_COFFEE_SHOP,HAC.281
AIRPORT_SHUTTLE,HAC.282
LUGGAGE_SERVICE,HAC.283
PIANO_BAR,HAC.284
VIP_SECURITY,HAC.285
DRIVING_RANGE,HAC.30
DUTY_FREE_SHOP,HAC.32
ELEVATOR,HAC.33
EXECUTIVE_FLR,HAC.34
GYM,HAC.35
EXPRESS_CHECK_IN,HAC.36
EXPRESS_CHECK_OUT,HAC.37
FLORIST,HAC.39
CONNECTING_ROOMS,HAC.4
FREE_AIRPORT_SHUTTLE,HAC.41
FREE_PARKING,HAC.42
FREE_TRANSPORTATION,HAC.43
GAMES_ROOM,HAC.44
GIFT_SHOP,HAC.45
HAIRDRESSER,HAC.46
ICE_MACHINES,HAC.52
GARAGE_PARKING,HAC.53
JACUZZI,HAC.55
JOGGING_TRACK,HAC.56
KENNELS,HAC.57
LAUNDRY_SVC,HAC.58
AIRLINE_DESK,HAC.6
LIVE_ENTERTAINMENT,HAC.60
MASSAGE,HAC.61
NIGHT_CLUB,HAC.62
SWIMMING_POOL,HAC.66
PARKING,HAC.68
ATM/CASH_MACHINE,HAC.7
POOLSIDE_SNACK_BAR,HAC.72
RESTAURANT,HAC.76
ROOM_SERVICE,HAC.77
SAFE_DEP_BOX,HAC.78
SAUNA,HAC.79
BABY-SITTING,HAC.8
SOLARIUM,HAC.83
SPA,HAC.84
CONVENIENCE_STOR,HAC.88
PICNIC_AREA,HAC.9
THEATRE_DESK,HAC.90
TOUR_DESK,HAC.91
TRANSLATION_SERVICES,HAC.92
TRAVEL_AGENCY,HAC.93
VALET_PARKING,HAC.97
VENDING_MACHINES,HAC.98
TELECONFERENCE,MRC.121
VOLTAGE_AVAILABLE,MRC.123
NATURAL_DAYLIGHT,MRC.126
GROUP_RATES,MRC.141
INTERNET-HIGH_SPEED,MRC.17
VIDEO_CONF_FACILITIES,MRC.53
ACC_BATHS,PHY.102
BR/L_PRINT_LIT,PHY.103
ADAPT_RM_DOORS,PHY.104
ACC_RM_WCHAIR,PHY.105
SERV_SPEC_MENU,PHY.106
WIDE_ENTRANCE,PHY.107
WIDE_CORRIDORS,PHY.108
WIDE_REST_ENT,PHY.109
ACC_LIGHT_SW,PHY.15
ACC_WCHAIR,PHY.28
SERV_DOGS_ALWD,PHY.29
ACC_WASHBASIN,PHY.3
ACC_TOILETS,PHY.32
ADAPT_BATHROOM,PHY.38
HANDRAIL_BTHRM,PHY.38
ADAPTED_PHONES,PHY.39
ACC_ELEVATORS,PHY.42
TV_SUB/CAPTION,PHY.45
DIS_PARKG,PHY.50
EMERG_COD/BUT,PHY.57
HANDICAP_FAC,PHY.6
DIS_EMERG_PLAN,PHY.60
HEAR_IND_LOOPS,PHY.65
BR/L_PRNT_MENU,PHY.66
DIS_TRAIN_STAF,PHY.71
PIL_ALARMS_AVL,PHY.76
ACC_BATH_CTRLS,PHY.79
PUTTING_GREEN,REC.5
TROUSER_PRESS,RMA.111
VIDEO,RMA.116
GAMES_SYSTEM_IN_ROOM,RMA.117
VOICEMAIL_IN_ROOM,RMA.118
WAKEUP_SERVICE,RMA.119
WI-FI_IN_ROOM,RMA.123
CD_PLAYER,RMA.129
BATH,RMA.13
MOVIE_CHANNELS,RMA.139
SHOWER,RMA.142
OUTLET_ADAPTERS,RMA.159
BIDET,RMA.16
DVD_PLAYER,RMA.163
CABLE_TELEVISION,RMA.18
OVERSIZED_ROOMS,RMA.185
TEA/COFFEE_MK_FACILITIES,RMA.19
AIR_CONDITIONING,RMA.2
TELEVISION,RMA.20
ANNEX_ROOM,RMA.204
FREE_NEWSPAPER,RMA.205
HONEYMOON_SUITES,RMA.206
INTERNETFREE_HIGH_IN_RM,RMA.207
MAID_SERVICE,RMA.208
PC_HOOKUP_INRM,RMA.209
PC_IN_ROOM,RMA.21
SATELLITE_TV,RMA.210
VIP_ROOMS,RMA.211
CORDLESS_PHONE,RMA.25
CRIBS_AVAILABLE,RMA.26
ALARM_CLOCK,RMA.3
PHONE-DIR_DIAL,RMA.31
FAX_FAC_INROOM,RMA.38
FREE_LOCAL_CALLS,RMA.45
HAIR_DRYER,RMA.50
INTERNET-HI_SPEED_IN_RM,RMA.51
IRON/IRON_BOARD,RMA.55
KITCHEN,RMA.59
BABY_LISTENING_DEVICE,RMA.6
LAUNDRY_EQUIPMENT_IN_ROOM,RMA.66
MICROWAVE,RMA.68
MINIBAR,RMA.69
NONSMOKING_RMS,RMA.74
REFRIGERATOR,RMA.88
ROLLAWAY_BEDS,RMA.91
SAFE,RMA.92
WATER_SPORTS,RST.110
ANIMAL_WATCHING,RST.126
BIRD_WATCHING,RST.127
SIGHTSEEING,RST.142
BEACH_WITH_DIRECT_ACCESS,RST.155
SKI_IN/OUT,RST.156
TENNIS_PROFESSIONAL,RST.157
FISHING,RST.20
GOLF,RST.27
FITNESS_CENTER,RST.36
BEACH,RST.5
HORSE_RIDING,RST.61
INDOOR_TENNIS,RST.62
MINIATURE_GOLF,RST.67
BOATING,RST.7
TENNIS,RST.71
SCUBA_DIVING,RST.82
SKEET_SHOOTING,RST.85
SNOW_SKIING,RST.88
BOWLING,RST.9
VOLLEYBALL,RST.98
ELEC_GENERATOR,SEC.15
EMERG_LIGHTING,SEC.19
FIRE_DETECTORS,SEC.22
GUARDED_PARKG,SEC.34
RESTRIC_RM_ACC,SEC.39
EXT_ROOM_ENTRY,SEC.40
INT_ROOM_ENTRY,SEC.41
SMOKE_DETECTOR,SEC.50
ROOMS_WITH_BALCONIES,SEC.51
SPRINKLERS,SEC.54
FIRST_AID_STAF,SEC.57
SECURITY_GUARD,SEC.58
VIDEO_SURVEIL,SEC.62
EXTINGUISHERS,SEC.89
FIRE_SAFETY,SEC.9
FEMA_FIRE_SAFETY_COMPLIANT,SEC.93
FIRE_SAF_NOT_STANDARD,SEC.95
According to the API, you can filter the offers by amenities:
https://developers.amadeus.com/self-service/category/hotel/api-doc/hotel-search/api-reference
I assume the multiple select list in the amenities property contains all the items you need.
EDIT: I noticed that unfortunately, the response example contains additional values, apart from the input. So the input is not enough.

How to get top 10 videos from your channel with the views count included in the response

So I have a ouath web app that connects to youtube. I use the youtube analytics calls to get information like number of subscribers from my channel. But right now I try to make a top 10 videos from my channel with the views count for every video included in the response. I use this documentation:
Top videos for subscribed or unsubscribed viewers
My call looks like this:
$command = 'curl -H "Authorization: Bearer ' . $access_token . '" "https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=' . date('Y-m-d', strtotime('-31 days')) . '&end-date=' . date('Y-m-d', strtotime('today')). '&metrics=views&dimensions=video&sort=views"';
But I get an error message as a response:
"The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v1/available_reports for a list of supported queries."
I also tried this call with YoTube data API:
$videos_url = 'https://www.googleapis.com/youtube/v3/search?part=snippet&forMine=true&order=viewCount&type=video&access_token=' . $access_token;
But it provides this response:
["kind"]=>
string(26) "youtube#searchListResponse"
["etag"]=>
string(57) ""######""
["nextPageToken"]=>
string(112) "#######"
["pageInfo"]=>
object(stdClass)#267 (2) {
["totalResults"]=>
int(1)
["resultsPerPage"]=>
int(5)
}
["items"]=>
array(1) {
[0]=>
object(stdClass)#270 (4) {
["kind"]=>
string(20) "youtube#searchResult"
["etag"]=>
string(57) ""#####""
["id"]=>
object(stdClass)#269 (2) {
["kind"]=>
string(13) "youtube#video"
["videoId"]=>
string(11) "####"
}
["snippet"]=>
object(stdClass)#273 (6) {
["publishedAt"]=>
string(24) "2016-09-14T14:49:49.000Z"
["channelId"]=>
string(24) "#####"
["title"]=>
string(12) "My Slideshow"
["description"]=>
string(87) "I created this video with the YouTube Slideshow Creator (http://www.youtube.com/upload)"
This response provides no views count. I need for every video to get the views count as well.
Any ideas on how to accomplish this? Any help is welcomed! Thank you all for your time!
The issue with your youtube analytics api request is sort parameter. Try using value -views instead of views. You can double check the API link you provided. Also set the max-results
Example URL :
https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3Dmine&start-date=2016-05-01&end-date=2016-09-01&metrics=views&dimensions=video&max-results=10&sort=-views&key={YOUR_API_KEY}