OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v3/dataproviders', {
method: 'GET',
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
{
"count": 4,
"results": [
{
"id": "frontlinesms",
"url": "https://ushahididocs.api.ushahidi.io//api/v3/dataprovider/frontlinesms",
"name": "FrontlineSMS",
"services": [
"sms"
],
"options": {
"server_url": {
"label": "FrontlineSMS Server URL",
"input": "text",
"description": "<p>The URL where the FrontlineSMS server is installed, i.e. <a href=\"https://server.url.com/\">https://server.url.com/</a></p>",
"rules": [
"required"
]
},
"key": {
"label": "Key",
"input": "text",
"description": "<p>The API key</p>",
"rules": [
"required"
]
},
"secret": {
"label": "Secret",
"input": "text",
"description": "<p>Set a secret so that only authorized FrontlineCloud accounts can send/recieve message.</p>\n<pre><code> You need to configure the same secret in the FrontlineCloud Activity.\n</code></pre>",
"rules": [
"required"
]
}
},
"inbound_fields": {
"Message": "text"
},
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": "nexmo",
"url": "https://ushahididocs.api.ushahidi.io//api/v3/dataprovider/nexmo",
"name": "Nexmo",
"services": [
"sms"
],
"options": {
"from": {
"label": "From",
"input": "text",
"description": "<p>The from number</p>",
"rules": [
"required"
]
},
"api_key": {
"label": "API Key",
"input": "text",
"description": "<p>The API key</p>",
"rules": [
"required"
]
},
"api_secret": {
"label": "API secret",
"input": "text",
"description": "<p>The API secret</p>",
"rules": [
"required"
]
}
},
"inbound_fields": {
"Message": "text"
},
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": "smssync",
"url": "https://ushahididocs.api.ushahidi.io//api/v3/dataprovider/smssync",
"name": "SMSSync",
"services": [
"sms"
],
"options": {
"intro_step1": {
"label": "Step 1: Download the \"SMSSync\" app from the Android Market.",
"input": "read-only-text",
"description": "<p>Scan this QR Code with your phone to download the app from the Android Market</p>\n<pre><code> <img src=\"https://ushahididocs.api.ushahidi.io/images/smssync.png\" width=\"150\"/>\n</code></pre>"
},
"intro_step2": {
"label": "Step 2: Android App Settings",
"input": "read-only-text",
"description": "<p>Turn on SMSSync and use the following link as the Sync URL: <a href=\"https://ushahididocs.api.ushahidi.io/sms/smssync\">https://ushahididocs.api.ushahidi.io/sms/smssync</a></p>"
},
"secret": {
"label": "Secret",
"input": "text",
"description": "<p>Set a secret so that only authorized SMSSync devices can send/recieve message.</p>\n<pre><code> You need to configure the same secret in the SMSSync App.\n</code></pre>",
"rules": [
"required"
]
}
},
"inbound_fields": {
"Message": "text",
"Date": "datetime"
},
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": "twilio",
"url": "https://ushahididocs.api.ushahidi.io//api/v3/dataprovider/twilio",
"name": "Twilio",
"services": [
"sms"
],
"options": {
"from": {
"label": "Phone Number",
"input": "text",
"description": "<p>The from phone number.\r\nA Twilio phone number enabled for the type of message you wish to send.</p>",
"rules": [
"required"
]
},
"account_sid": {
"label": "Account SID",
"input": "text",
"description": "<p>The unique id of the Account that sent this message.</p>",
"rules": [
"required"
]
},
"auth_token": {
"label": "Auth Token",
"input": "text",
"description": "",
"rules": [
"required"
]
},
"sms_auto_response": {
"label": "SMS Auto response",
"input": "text",
"description": "",
"rules": [
"required"
]
}
},
"inbound_fields": {
"Message": "text"
},
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"offset": 0,
"order": "asc",
"orderby": "id",
"curr": "https://ushahididocs.api.ushahidi.io//api/v3/dataproviders?orderby=id&order=asc&offset=0",
"next": "https://ushahididocs.api.ushahidi.io//api/v3/dataproviders?orderby=id&order=asc&offset=0",
"prev": "https://ushahididocs.api.ushahidi.io//api/v3/dataproviders?orderby=id&order=asc&offset=0",
"total_count": 4
}
OK
const response = await fetch('https://ushahididocs.api.ushahidi.io/api/v3/dataproviders/1', {
method: 'GET',
headers: {
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
{
"id": "email",
"url": "https://ushahididocs.api.ushahidi.io//api/v3/dataprovider/email",
"name": "Email",
"services": [
"email"
],
"options": {
"intro_text": {
"label": "",
"input": "read-only-text",
"description": "<p>In order to receive posts by email, please input your email account settings below</p>"
},
"incoming_type": {
"label": "Incoming Server Type",
"input": "radio",
"description": "",
"options": [
"POP",
"IMAP"
],
"rules": [
"required",
"number"
]
},
"incoming_server": {
"label": "Incoming Server",
"input": "text",
"description": "<p>Examples: mail.yourwebsite.com, imap.gmail.com, pop.gmail.com</p>",
"rules": [
"required"
]
},
"incoming_port": {
"label": "Incoming Server Port",
"input": "text",
"description": "<p>Common ports: 110 (POP3), 143 (IMAP), 995 (POP3 with SSL), 993 (IMAP with SSL)</p>",
"rules": [
"required",
"number"
]
},
"incoming_security": {
"label": "Incoming Server Security",
"input": "radio",
"description": "",
"options": [
"None",
"SSL",
"TLS"
]
},
"incoming_username": {
"label": "Incoming Username",
"input": "text",
"description": "",
"placeholder": "Email account username",
"rules": [
"required"
]
},
"incoming_password": {
"label": "Incoming Password",
"input": "text",
"description": "",
"placeholder": "Email account password",
"rules": [
"required"
]
}
},
"inbound_fields": {
"Subject": "text",
"Date": "datetime",
"Message": "text"
},
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}