I am trying to get button's link from message of gmail (ex. verify account button). Is there any way to make it via Google API?
I used Api to get all messages first: https://www.googleapis.com/gmail/v1/users/me/messages
Then used this api to get the message details: https://www.googleapis.com/gmail/v1/users/me/messages/{message_id}
but can't find the link inside the email body, here is the response!!
{
"id": "1785a64978e454be",
"threadId": "1785a528dc1e905c",
"labelIds": [
"IMPORTANT",
"CATEGORY_PERSONAL",
"INBOX"
],
"snippet": "Invesna Logo Hello Turki Thank you for joining our community Best wishes INVESNA Team Verify Now This is an automated email. If you've received this email by mistake, please",
"payload": {
"partId": "",
"mimeType": "multipart/alternative",
"filename": "",
"headers": [
{
"name": "Delivered-To",
"value": "areeb.*****#gmail.com"
},
{
"name": "Received",
"value": "by 2002:a6b:916:0:0:0:0:0 with SMTP id t22csp3887526ioi; Mon, 22 Mar 2021 07:44:05 -0700 (PDT)"
},
{
"name": "X-Google-Smtp-Source",
"value": "ABdhPJyvgEKiYNby+5oLp9d6ZLU4ujfWHmppkGFvw2POAHup5hfkbaexaDRj9bwjk1zLmhyuIfsq"
},
{
"name": "X-Received",
"value": "by 2002:ac8:4752:: with SMTP id k18mr234477qtp.158.1616424245098; Mon, 22 Mar 2021 07:44:05 -0700 (PDT)"
},
{
"name": "ARC-Seal",
"value": "i=1; a=rsa-sha256; t=1616424245; cv=none; d=google.com; s=arc-20160816; b=cTBJJWs+fBO2mU4nAKoz+VzfvNI7RrAW3PKApijZ0LI4v6Ma1XAQxKilc+IEiwcmFE D6cTkU9CVAS9f+IOaE3bb8NCnQVz7mFvFkD72vvDeWaMsW2V2jbKZoFPdFKDGZ6b70fq WUXxy5uCHkafF9gAtmPFU2eTfMRRk5uv3ZA8XGcO87JWSYngzz/DoOdD6cQOVfIiv4HF YGAITJGHTYL2kgwdRVlSJCKQBpQZIJqM3pUHaYJ3+uXs2rg1XkaLyFudF3brG7tKUOMN gCXsyINhAfuTw2bIrWmSX+8B3AHG+h+aQfTbl9GNr3oBLYYM7BRMSfG2S8jldm6XnEpM ZUEg=="
},
{
"name": "ARC-Message-Signature",
"value": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:mime-version:to:from:subject:date:message-id :dkim-signature:dkim-signature; bh=RToLBuWpZqa2f+3AtVt2tvS0pNeSTnAA4DQnGQ8mMWU=; b=prTkhBY/VOg77E8LDGE3HZD7rGb2vQuG2uln53Jh3ee4fXIKZtB6RwVUjBrodFyb6S FXUbY0Iox/TWv+Maqr0p89waYhGYy/aQD4g6G3/8BwLSCqAOc65JsKMGwGor/t2ZdsOZ w97c2w3eswYEfu9FuhXyCLV9Jbg/4bw32JWb59mKuAQSKx6aeiipXShmPmAmI5FWxlmu y/dbft5H4weUd3jXQjbAqXnfzyEso+nbl2iexfobZ4vqRPzarwk9tSZEC73mgqbsA5ZF zx9xPOYxJbMVin5Wrsit0p8xVv3DD1UlPGqNCItAviqUkHqtUDkznPmiWpFXtXLxoyk2 3SyA=="
},
{
"name": "ARC-Authentication-Results",
"value": "i=1; mx.google.com; dkim=pass header.i=#areebgroup.com header.s=ly5fxy3f4dncdbipp3gron65eulkyt3p header.b=XztlZ3Jb; dkim=pass header.i=#amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=FtocR6ro; spf=pass (google.com: domain of 010001785a649518-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com designates 54.240.48.108 as permitted sender) smtp.mailfrom=010001785a649518-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com"
},
{
"name": "Return-Path",
"value": "<010001785a649518-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com>"
},
{
"name": "Received",
"value": "from a48-108.smtp-out.amazonses.com (a48-108.smtp-out.amazonses.com. [54.240.48.108]) by mx.google.com with ESMTPS id cj6si7995790qvb.74.2021.03.22.07.44.04 for <areeb.testing2#gmail.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Mon, 22 Mar 2021 07:44:05 -0700 (PDT)"
},
{
"name": "Received-SPF",
"value": "pass (google.com: domain of 010001785a649518-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com designates 54.240.48.108 as permitted sender) client-ip=54.240.48.108;"
},
{
"name": "Authentication-Results",
"value": "mx.google.com; dkim=pass header.i=#areebgroup.com header.s=ly5fxy3f4dncdbipp3gron65eulkyt3p header.b=XztlZ3Jb; 18-d06bf9df-a011-4cee-81ed-9328a70eaa39-000000#amazonses.com"
},
{
"name": "DKIM-Signature",
"value": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ly5fxy3f4dncdbipp3gron65eulkyt3p; d=areebgroup.com; t=1616424244; h=Message-ID:Date:Subjec"
},
{
"name": "DKIM-Signature",
"value": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1616424244; h=Message-ID:Date:Subject:Fro"
},
{
"name": "Message-ID",
"value": "<010001785>
},
{
"name": "Date",
"value": "Mon, 22 Mar 2021 14:44:04 +0000"
},
{
"name": "Subject",
"value": "Verify Your Account"
},
{
"name": "From",
"value": "Invesna <account#aree>"
},
{
"name": "To",
"value": "areeb.**#gmail.com"
},
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Content-Type",
"value": "multipart/alternative; boundary=\"_=_swift_1616424243_8452744c94a6060ff23d75c5b712dcb6_=_\""
},
{
"name": "X-SES-Outgoing",
"value": "2021.03.22-54.240.48.108"
},
{
"name": "Feedback-ID",
"value": "1.us-ea"
}
],
"body": {
"size": 0
},
"parts": [
{
"partId": "0",
"mimeType": "text/plain",
"filename": "",
"headers": [
{
"name": "Content-Type",
"value": "text/plain; charset=utf-8"
},
{
"name": "Content-Transfer-Encoding",
"value": "quoted-printable"
}
],
"body": {
"size": 5094,
"data": "PCFET0NUWVBFIGh0bWw-DQo8aHRtbCBsYW5nPSJlbiI-DQo8Ym9keT4NCjxkaXYgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmN2Y5ZmM7IHBhZGRpbmctYm90dG9tOiAzcmVtIj4NCiAgICA8aW1nIHNyYz0iaHR0cDovL2FwaS10ZXN0LmludmVzbmEud9JbnZlc25hX2FwcCIgdGFyZ2V0PSJfYmxhbmsiPg0KICAgICAgICAgICAgICAgICAgICAgICAgPGltZw0KICAgICAgICAgICAgPg0KPC9ib2R5Pg0KPC9odG1sPg0K"
}
},
{
"partId": "1",
"mimeType": "text/html",
"filename": "",
"headers": [
{
"name": "Content-Type",
"value": "text/html; charset=utf-8"
},
{
"name": "Content-Transfer-Encoding",
"value": "quoted-printable"
}
],
"body": {
"size": 10026,
"data": "PCFkb2N0eXBlIGh0bWw-DQo8aHRtbCBsYW5nPSJlbiI-PGJvZHkgc3R5bGU9ImZvbnQtZmFtaWx5OiAtYXBwbGUtc3lzdGVtLCBCbGlua01hY1N5c3RlbUZvbnQsICdTZWdvZSBVSScsIFJvYm90bywgSGVsdmV0aWNhLCBBcmlhbCwgc2Fucy1zZXJpZiwgJ0FwcGxlIENvbG9yIEVtb2ppgYWx0PSJQYXR0ZXJuIiBzdHlsZT0iZm9udC1mYW1pbHk6IC1hcHBsZS1zeXN0ZW0sICAgICAgPC91bD4NCjwvZGl2Pg0KICAgIDwvZGl2Pg0KPC9kaXY-DQo8L2JvZHk-PC9odG1sPg0K"
}
}
]
},
"sizeEstimate": 20887,
"historyId": "79",
"internalDate": "16164240"
}
Resolved, my email body was encoded by base64 encoder, i decode it first then i found the link i need
Reference:
Resource: MessagePartBody
Related
I need to compare 2 JSON arrays using Mule 4 dataweave 2.0 to get matching and un-matching outputs.
The sample input JSON payload is given below:
[
{
"CODE": "A11",
"NAME": "Alpha",
"ID": "C10000"
},
{
"CODE": "B12",
"NAME": "Bravo",
"ID": "B20000"
},
{
"CODE": "C11",
"NAME": "Charlie",
"ID": "C30000"
},
{
"CODE": "D12",
"NAME": "Delta",
"ID": "D40000"
},
{
"CODE": "E12",
"NAME": "Echo",
"ID": "E50000"
}
]
This has to be compared to the below on ID/IDENTITY field.
[
{
"IDENTITY": "D40000",
"NM": "Delta"
},
{
"IDENTITY": "C30000",
"NM": "Charlie"
}
]
My expected output is 2 variable arrays containing matching and un-matching objects:
varMatch:
[
{
"CODE": "C11",
"NAME": "Charlie",
"ID": "C30000"
},
{
"CODE": "D12",
"NAME": "Delta",
"ID": "D40000"
}
]
varUnmatch:
[
{
"CODE": "A11",
"NAME": "Alpha",
"ID": "C10000"
},
{
"CODE": "B12",
"NAME": "Bravo",
"ID": "B20000"
},
{
"CODE": "E12",
"NAME": "Echo",
"ID": "E50000"
}
]
If that ID map is coming from somewhere else and you can't change its structure, I'd probably remap it and then use it like so:
%dw 2.0
output application/json
var identMap = [
{
"IDENTITY": "D40000",
"NM": "Delta"
},
{
"IDENTITY": "C30000",
"NM": "Charlie"
}
]
var remapped = identMap reduce ((item,accum={}) -> accum ++ (item.IDENTITY): 1)
---
payload groupBy (if (remapped[$.ID]?) "varMatched" else "varUnmatched")
which produces
{
"varUnmatched": [
{
"CODE": "A11",
"NAME": "Alpha",
"ID": "C10000"
},
{
"CODE": "B12",
"NAME": "Bravo",
"ID": "B20000"
},
{
"CODE": "E12",
"NAME": "Echo",
"ID": "E50000"
}
],
"varMatched": [
{
"CODE": "C11",
"NAME": "Charlie",
"ID": "C30000"
},
{
"CODE": "D12",
"NAME": "Delta",
"ID": "D40000"
}
]
}
Hope this helps
%dw 2.0
var input1=[{
"CODE": "A11",
"NAME": "Alpha",
"ID": "C10000"
},
{
"CODE": "B12",
"NAME": "Bravo",
"ID": "B20000"
},
{
"CODE": "C11",
"NAME": "Charlie",
"ID": "C30000"
},
{
"CODE": "D12",
"NAME": "Delta",
"ID": "D40000"
},
{
"CODE": "E12",
"NAME": "Echo",
"ID": "E50000"
}
]
var input2=[
{
"IDENTITY": "D40000",
"NM": "Delta"
},
{
"IDENTITY": "C30000",
"NM": "Charlie"
}
]
var varMatch = input1 map $ filter (input2.IDENTITY contains $.ID)
var varUnmatch = input1 -- varMatch
output application/json
---
{
varMatch: varMatch,
varUnmatch: varUnmatch
}
Sample Output
{
"varMatch": [
{
"CODE": "C11",
"NAME": "Charlie",
"ID": "C30000"
},
{
"CODE": "D12",
"NAME": "Delta",
"ID": "D40000"
}
],
"varUnmatch": [
{
"CODE": "A11",
"NAME": "Alpha",
"ID": "C10000"
},
{
"CODE": "B12",
"NAME": "Bravo",
"ID": "B20000"
},
{
"CODE": "E12",
"NAME": "Echo",
"ID": "E50000"
}
]
}
Here's another solution, albeit the previous two are solving your problem:
%dw 2.0
output application/dw
var data = [
{
"CODE": "A11",
"NAME": "Alpha",
"ID": "C10000"
},
{
"CODE": "B12",
"NAME": "Bravo",
"ID": "B20000"
},
{
"CODE": "C11",
"NAME": "Charlie",
"ID": "C30000"
},
{
"CODE": "D12",
"NAME": "Delta",
"ID": "D40000"
},
{
"CODE": "E12",
"NAME": "Echo",
"ID": "E50000"
}
]
var searchData = [
{
"IDENTITY": "D40000",
"NM": "Delta"
},
{
"IDENTITY": "C30000",
"NM": "Charlie"
}
]
---
data dw::core::Arrays::partition (e) -> searchData.*IDENTITY contains e.ID
Pick the one that perfoms the best and use it.
I'm trying to connect to a database through a data gateway (SQL Server Connector) with ARM templates. But I'm not sure if I miss something because I'm getting connection error with the gateway.
This is what I have so far in my api connection:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"connections_sql_name": {
"defaultValue": "sql",
"type": "String"
},
"connections_sql_displayName": {
"defaultValue": "displaynameDB",
"type": "String"
},
"server": {
"defaultValue": "SERV01",
"type": "String"
},
"database": {
"defaultValue": "DB01",
"type": "String"
},
"authType": {
"defaultValue": "windows",
"type": "String"
},
"username": {
"defaultValue": "USER01",
"type": "String"
},
"password": {
"defaultValue": "PASS123",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('connections_sql_name')]",
"location": "northeurope",
"properties": {
"displayName": "[parameters('connections_sql_displayName')]",
"customParameterValues": {},
"parameterValues": {
"server": "[parameters('server')]",
"database": "[parameters('database')]",
"authType": "[parameters('authType')]",
"username": "[parameters('username')]",
"password": "[parameters('password')]"
},
"api": {
"id": "[concat('/subscriptions/{sub-id}/providers/Microsoft.Web/locations/northeurope/managedApis/', parameters('connections_sql_name'))]"
}
}
}
]
}
And this is a part of my logic app under inputs:
"gateway": {
"gatewaySettings": {
"connectionDetails": [
"[parameters('gatewayServer')]",
"[parameters('gatewayDatabase')]"
],
"credentialType": "Windows",
"dataSourceType": "sql"
},
"type": "gatewaySetting"
},
Any help is appreciated! :)
Try removing the gateway block from the Logic App definition and changing the connection definition to this:
{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('connections_sql_name')]",
"location": "northeurope",
"properties": {
"displayName": "[parameters('connections_sql_displayName')]",
"customParameterValues": {
},
"parameterValues": {
"server": "[parameters('server')]",
"database": "[parameters('database')]",
"authType": "[parameters('authType')]",
"username": "[parameters('username')]",
"password": "[parameters('password')]",
"gateway": {
"id": "/subscriptions/{sub-id}/resourceGroups/{gateway-resource-group-name}/providers/Microsoft.Web/connectionGateways/{gateway-name}"
}
},
"api": {
"id": "[concat('/subscriptions/{sub-id}/providers/Microsoft.Web/locations/northeurope/managedApis/', parameters('connections_sql_name'))]"
}
}
}
The documentation isn't very helpful regarding the gateway property in connection resources.
I am using bot framework v4. I have developed a chatbot using .Net Core. The bot is integrated with LUIS and Qna Maker. One issue I am facing is that the bot duplicates the message that comes from the user. Please look at the screenshot below:
The replies I get from the bot are perfectly fine. The flow of the bot is as intended. I just cannot figure out why the message from user is being duplicated. I am using DirectLine for this. I will share whatever code part is needed.
{
"activities": [
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000000",
"timestamp": "2019-12-02T19:41:57.1284328Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"size": "large",
"url": "https://i.imgur.com/ViaEUnA.png"
}
]
}
],
"horizontalAlignment": "Center"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"color": "light",
"text": "Welcome to CIVIC Financial Services",
"wrap": true
},
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"color": "light",
"text": "I am S.U.E",
"wrap": true
},
{
"type": "TextBlock",
"color": "light",
"text": "I can help you answer your questions. Familiarize yourself with CIVIC Financial Services.",
"wrap": true
},
{
"type": "TextBlock",
"color": "light",
"text": "If you want to talk to a Customer Service Agent, just type \"I want to talk to a Customer Service Agent\".",
"wrap": true
}
],
"separator": true,
"horizontalAlignment": "Left"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"data": {
"action": "aboutCivic"
},
"title": "About CIVIC"
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"actions": [
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "We are open from Monday through Friday from 8:00am to 6:00pm.",
"wrap": true
}
],
"style": "emphasis"
},
"title": "When are you open?"
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Image",
"size": "stretch",
"url": "https://i.imgur.com/gBVgI25.png",
"horizontalAlignment": "center"
},
{
"type": "TextBlock",
"text": "AZ, CA, CO, FL, GA, HI, NC, NV, OR, SC, TN, TX, UT, VA & WA",
"wrap": true
}
],
"style": "emphasis"
},
"title": "Do you have an office near me? "
},
{
"type": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "8 to 10 days, it all depends on how it takes to get access to the property.",
"wrap": true
}
],
"style": "emphasis"
},
"title": "How quickly can we close? "
}
],
"style": "emphasis"
},
"title": "FAQs"
}
]
}
}
],
"entities": [],
"replyToId": "8WGOnspSxN3"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000001",
"timestamp": "2019-12-02T19:43:39.96502Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"entities": [
{
"type": "ClientCapabilities",
"requiresBotState": true,
"supportsListening": true,
"supportsTts": true
}
],
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000002",
"timestamp": "2019-12-02T19:43:41.7278914Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Sorry, I didn't understand. Consider rephrasing your question or contacting a customer agent",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000001"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000003",
"timestamp": "2019-12-02T20:00:25.784598Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "helo",
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000004",
"timestamp": "2019-12-02T20:00:26.5739342Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Sorry, I didn't understand. Consider rephrasing your question or contacting a customer agent",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000003"
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000005",
"timestamp": "2019-12-02T20:00:27.3293896Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "r_1575315715",
"name": "",
"role": "user"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "hello",
"channelData": {
"siteDomain": "https://websiteae1.stackblitz.io/"
}
},
{
"type": "message",
"id": "BR1wBZw7w2852JMLobk0EC-o|0000006",
"timestamp": "2019-12-02T20:00:27.6064185Z",
"channelId": "directline",
"from": {
"id": "CivicDevBot",
"name": "CivicChat"
},
"conversation": {
"id": "BR1wBZw7w2852JMLobk0EC-o"
},
"text": "Hello",
"inputHint": "acceptingInput",
"attachments": [],
"entities": [],
"replyToId": "BR1wBZw7w2852JMLobk0EC-o|0000005"
}
],
"watermark": "6"
}
I have successfully logged in Cobrand and User and set up DAG. I am trying to add an account with FMFA, but I end up with the error response as shown below.
https://developer.api.yodlee.com:443/ysl/restserver/v1/providerAccounts?providerId=16445
Credentials Param:
{ "loginForm" : {
"id": 16103,
"forgetPasswordURL": "http://64.14.28.129/dag/index.do",
"formType": "login",
"row": [
{
"id": 150862,
"label": "Catalog",
"form": "0001",
"fieldRowChoice": "0001",
"field": [
{
"id": 65499,
"name": "LOGIN",
"type": "text",
"value": "ibrahimHassan.site16445.1",
"isOptional": false,
"valueEditable": true
}
]
},
{
"id": 150863,
"label": "Password",
"form": "0001",
"fieldRowChoice": "0002",
"field": [
{
"id": 65500,
"name": "PASSWORD",
"type": "password",
"value": "site16445.1",
"isOptional": false,
"valueEditable": true
}
]
}
]
}
}
ProviderId : 16445
Response:
{
"errorCode": "Y400",
"errorMessage": "Invalid value for login, site [DagSiteTokenFMPA]",
"referenceCode": "f1493111410473e4L27n"
}
I need the response returned by this service so that I can model my iOS Application accordingly. If someone points out the APIs to hit in the correct order and the parameters for the API body.
From your request we can see the login form is not right. Please find the right login form-
Hope this helps.
{
"loginForm": {
"id": 16126,
"forgetPasswordURL": "http://64.14.28.129/dag/index.do",
"formType": "login",
"row": [
{
"id": 150876,
"label": "Catalog",
"form": "0001",
"fieldRowChoice": "0001",
"field": [
{
"id": 65513,
"name": "LOGIN",
"type": "text",
"value": "ibrahimHassan.site16445.1",
"isOptional": false,
"valueEditable": true
}
]
},
{
"id": 150877,
"label": "Password",
"form": "0001",
"fieldRowChoice": "0002",
"field": [
{
"id": 65514,
"name": "PASSWORD",
"type": "password",
"value": "site16445.1",
"isOptional": false,
"valueEditable": true
}
]
}
]
}
}
I want to retrieve the different tag values in an NSString.
NSString *test =
{
"data": [
{
"id": "100002319144563_125257217561582",
"from": {
"name": "Umair Ahmed",
"id": "100002319144563"
},
"message": "Hello Umair Here",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/100002319144563/posts/125257217561582"
},
{
"name": "Like",
"link": "http://www.facebook.com/100002319144563/posts/125257217561582"
}
],
"privacy": {
"description": "Everyone",
"value": "EVERYONE"
},
"type": "status",
"application": {
"name": "iPhone",
"id": "213257025359930"
},
"created_time": "2011-07-08T11:59:15+0000",
"updated_time": "2011-07-08T11:59:15+0000"
},
{
"id": "100002319144563_125251050895532",
"from": {
"name": "Umair Ahmed",
"id": "100002319144563"
},
"message": "Hello testing testing",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/100002319144563/posts/125251050895532"
},
{
"name": "Like",
"link": "http://www.facebook.com/100002319144563/posts/125251050895532"
}
]
}
]
}
How can I retrieve the name and message tag values into an array or dictionary?
It looks like a JSON string, so just use one of JSON libraries, like TouchJSON or JSONKit and you can easily extract the data from the structures they will provide you.