PRODUCTION
This webservice is used to update the network user suscription. The users information has to be retreived thru the network/query-customers service.
Resource information |
|
Authentication |
Required |
HTTP Method |
POST |
Response |
JSON |
Version |
1 |
Resource URL
<https://www.mapapropapp.com/api/action/network-v1/update-suscription>
Parameters
Key |
Type |
Required |
Description |
agencyId |
string |
yes |
The agency ID provided by ‣ or ‣ webservices in the ‣ |
planDescription |
string |
yes |
A description of the suscription of the user. Like "Plan Plus 5 Publications". This text is displayed to the customer. |
planMaxPublications |
int |
yes |
The name of the portal submiting the question. ie. Trovit |
planCost |
string |
yes |
The cost of the suscription. This is an arbitrary string so you should send the $ sign included of the currency. This text is displayed to the user. |
planBillingCycle |
string |
yes |
Indicate the billing cycle for the plan like "Weekly", "Monthly". This text is displayed to the user. |
planUpgradeURL |
string |
yes |
The URL where the user can click and upgrade, cancel or modify his suscription. |
listingURL |
string |
yes |
The URL of in your network with all the properties of the user. For example http://yoursite.com/nelson-properties |
accountStatus |
string |
yes |
A text indicating the current status of the account. This is useful to show if the user is due for payment , with suspended account or to show the balance. |
Sample code
POST /api/action/network-v1/update-suscription HTTP/1.1
Host: www.mapapropapp.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Authorization: Bearer ya29.1.AADtN_UxybTdjLw9j.X96lg_SXIgc3wTtek4q2WvfETzSrz7Q6loEYoJEWd1x4qvlpGw
agencyId=AD199991&planDescription=PLUS%2010&planMaxPublications=10&planCost=%24%2033&planBillingCycle=SEMANAL
&planUpgradeURL=https%3A%2F%2Fmysite.com%2Fupgrade%3FagencyId%3DAIGIGI
&listingURL=https%3A%2F%2Fmysite.com%2Fjulian-inmobiliaria
&accountStatus=AL%20DIA
Response
The JSON response will tell you if the question was submitted, if not, will tell you what happened showing that is in the queue for moderation because looks like spam or has invalid fields.
Object |
Field |
Type |
Required |
Description |
Response |
success |
boolean |
yes |
A boolean showing if the submission was or not successful |
|
error |
string |
no |
A text indicating the type of error if success == false |
Sample code
{
"success": false,
"error": "AGENCY_NOT_FOUND"
}