This method is used when you want to update the information of the subscribers in the system. Inside the body in json format, as in the “InsertAPISubscriber” method, “FirstName” (Subscriber Name), “LastName” (Subscriber Surname), “Mobile” (Subscriber Phone), “Email” (Subscriber Email), “Twitter” (Twitter Address), “Facebook” (Facebook Address) and “Notes” parameters should be given, in addition to this, the “subscriberId” parameter, in which the id value of the subscriber to be updated, must be added in the query type.

 Authorization header should be entered as “token_type” value returned as a result of token request, space character, “Access_token” value.

As a result of the request, a message stating that the update has been made is received. When you make a request to the “GetAllSubscribers” method, you can see the record of the subscriber you have updated.

UpdateAPISubscriber Sample Code (C#)

private static IRestResponse UpdateApiSubscriber()
            RestClient client = new RestClient("https://api.flexxii.com");
            RestRequest request = new RestRequest("api/Subscribers/UpdateAPISubscriber", Method.PUT);
            request.AddHeader("Content-Type", "application/json; charset=utf-8");
            request.AddQueryParameter("subscriberId", subscriberId);
            request.AddJsonBody(new { "FirstName": "string", "LastName": "string", "Mobile": "string", "Email": "string","Password": "string","Twitter": "string", "Facebook": "string","Notes": "string" });
            request.AddHeader("Authorization", content_type + " " + access_token);

            IRestResponse response = client.Execute(request);
            return response;

Was this helpful?

0 / 0