This repository was archived by the owner on Feb 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Example : insert a member
basgys edited this page Oct 4, 2011
·
2 revisions
XML Schema
<resource path="member/insertMember/{token}">
<param name="token" style="template" type="xs:string"/>
<method name="POST">
<request>
<representation mediaType="*/*"/>
</request>
<response>
<representation mediaType="*/*"/>
</response>
</method>
</resource><xs:complexType name="synchroMember">
<xs:sequence>
<xs:element name="dynContent">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="entry">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="key" type="xs:string"/>
<xs:element minOccurs="0" name="value" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="email" type="xs:string"/>
<xs:element minOccurs="0" name="memberUID" type="xs:string"/>
</xs:sequence>
</xs:complexType>Summary
- Endpoint : apimember
- Name : member/insertMember
- Method : POST
- URI parameters : token
- Body parameters : synchroMember structure
Method call
emv = Emailvision::Api.new do |o|
# Considering that user/pass/key/... are already set
o.endpoint = "apimember"
end
emv.open_connection # Should return true
if emv.connected?
body = {
:synchro_member=>{
:dyn_content=>{
:entry=>[
{:key=>"FIRSTNAME", :value=>"Bastien"},
{:key=>"LASTNAME", :value=>"Gysler"}
]
},
:email=>"my@mail.com"
}
}
emv.post.member.insert_member(:body => body).call
else
# Something went wrong...
endEntry Array
You can send as many entry as you want. It depends on fields you created on Emailvision
memberUID
This parameter is optional (minOccurs="0"). Choose between email and memberUID
Explanation
- post is the HTTP verb to use
- member.insert_member is the method name
- token token is automatically given
- :body => body is the body parameters. (token is automatically given)
- call is the keyword to perform the API call