Sorting of emails [REST API] [PHP]

Hello, I am trying to sort emails by using URL parameters. I am trying to sort the messages by date of creation, or in any case that would have the most recently created e-mail first and in descending order.

So far, I have https://secure.eloqua.com/API/REST/1.0/assets/emails?search= * SNL * & page = 1 & number = 50 & depth minimum = & spell = converted & dir = desc

The & sort = converted & dir = desc settings seem to do absolutely nothing.

I think that converted is a timestamp because updatedAt resembling a timestamp as well, but this is perhaps the place where it was created. Maybe even sorting by ID would be a good thing because

I think that id autoincrements. So more the ID, the most recent of the email, but this assumption may fail in some cases. I tried & sort = id & dir = desc and which does not change the order as well.

So what are the properties can I sort through emails? Any ideas on how to sort to have emails more recently created first and in descending order?

I also use an instance of E9.

Hi John,.

You can use the following query parameters when you search Emails using the REST API:

  • GET/assets/emails? depth = {depth} & count = {number} & page = {page} & search = {search} & orderBy = {orderBy} & lastUpdatedAt = {lastUpdatedAt}

The document following (to access emails using the REST API) described the available properties on the object of the contract. To retrieve the most recent, you can order in "updatedAt.

I hope this helps.

Thank you

Fred

Tags: Marketers

Similar Questions

  • Emails & REST API

    Hello

    I started working with the API REST Eloqua and ran into several problems with the functionality of e-mail.

    (1) I can't find the way to match email URL to the URL of the contact activities

    -URL of the section 'hyperlinks' e-mail is Eloqua format. for example: http://s2137571027.t.en25.com/e/er?lid=8 & s = 2137571027 & -request used: ' / assets/E-mail / < EMAILID > '

    -URL of contact activities are normal url. for example: http://www.marketingautomationsoftware.com/ - query used: ' / data/activities/contact / < CONTACTID >? type = webVisit & < START_DATE > = startDate & endDate = < end_date > '

    I tried to follow redirects, but this approach is similar to hacky and unreliable way.

    (2) I can't find any information of when certain url has been added to some one email.

    The closest I found was "e-mail deployments" feature - request used: ' / assets/E-mail/deployments.

    But it gives me a number of times by e-mail has been sent, but not what was included in each particular email - response I get: "{'elements': [], 'page': 1,"pageSize": 1000,"total": 3}'"

    I would appreciate help

    Thank you!

    Eugene

    Hi Eugene,

    (1) I've been working through this with the heads of appropriate product use case and unfortunately it seems that you have discovered a stream that we cannot support right now - your question, the URL to return to the e-mail data are after redirect URL in the activity of contact direct are redirect pre. We agreed that the implementation of a way to reconcile this is logical, however I can't give you any sort of timeline on it right now.

    (2) we do not have version e-mail assets or time stamp the individual URL, so the best option would use the date of creation or the date last modified on the e-mail itself.

    Thank you

    Chris

  • REST API PHP: Check the existence of single room

    Y at - there a way that miss me in the api, or another way to check the existence of a single piece before calling

    AFCSAccount createRoom?   I see that there is a getRoomInfo method, but that seems to apply only to the rooms which are active (well at least I get nothing for inactive rooms, I could hurt).   I see also there is a listRooms method but when I have 10,000 rooms that will be a call quite unprofitable.

    So, I'm looking for a way to check if a room is available before calling createRoom.   Any advice would be appreciated.

    Thank you

    Eric

    Currently there is no way to verify the existence of a room (in fact, it is a way, but is not exposed).

    But considering that no matter what you do it will cost an HTTP request anyway, just always create the room and catch the error (the HTTP request returns a 403 error)

  • Get the emails in descending order of creation date. [REST API]

    Hello I am trying to GET emaiils of the REST API in order descending creation date. So far, my URL params look like:

    emails/assets /? Search = * BN * & page = 1 & number = 50 & depth minimum = & orderBy = converted

    This seems to put in ascending order. I wonder if I can specify the order? I noticed for the contacts there is a sorting = {sortOn} & dir = desc, so is it possible

    to do with e-mails? I tried to join the above URL & dir = desc but not luck and assuming that he only is not supported from this page http://topliners.eloqua.com/docs/DOC-3083.

    Yes I can reverse my logic in the program from the end of emails received, but I wonder if I can simply specify order emails using the REST API?

    Please let me know and thank you.

    Hi John,.

    To sort by a column name, such as the 'name' field, you can simply add the following query string parameters: & orderBy = name % 20desc

    The sort directions are: asc | / / DESC

    We will share a post soon to describe how to do this. The API should support the "dir" query string argument, but it doesn't seem to work. We will look into it as well.

    Hope this helps,

    Fred

  • Uploading images using the REST API from PHP

    Does anyone at - he had success with the download of the images through the Eloqua Rest API using PHP?

    I have the final point, but I can't understand what kind of information needs to go the variable $data.

    That's what I currently have:

    <? PHP

    ini_set ("display_errors", 1);

    include("..) /.. ("/ eloquaRequest.php");

    $eloquaRequest = new EloquaRequest ('Instancename', 'username', 'password', 'https://secure.eloqua.com/API/REST/1.0');

    $data = new stdClass();

    $data-> image = file_get_contents("./easy.jpg");

    $data-> name = 'this is a file name ";

    $data-> filename = "luke.jpg";

    $data-> contentType = "image/jpeg";

    $response = $eloquaRequest-> message (' assets/image/content', $data);

    var_dump ($Response);

    The error I get is the following, but I think that it is a standard response, if your image does not go through correctly:

    Array (1) {[0] = > object (stdClass) #3 (2) {["type"] = > string(9) "FileError" ["requirement"] = > object (stdClass) #4 (3) {["type"] = > string (15) "SizeRequirement" ["maxSize"] = > int (52428800) ["minSize'] = > int (1)}}}

    Thank you

    Hi Phil,

    I had to find that it all the time, it took me several hours. I hope that it allows you to save a headache.

    Eloqua is very strict in dealing with the content-type header; See the comment here for a little explanation; REST API - download Images

    So what you need to do in PHP, is to build the query string for the image of yourself. You can do as follows (to adapt to your needs, not yet tested);

    <>

    [...]

    $img_path = '. / easy.jpg';

    $img_info = getimagesize ($img_path);

    $img_real = realpath ($img_path);

    $data = "-ELOQUA_BOUNDARY\r\n".

    ' Content-Disposition: form-data; name =-"Filedata\"; filename =------"".baseName ($img_real). » \"\r\n ».

    "Content-Type: '. '" $img_info ['mime']. "" \r\n ".

    "\r\n".

    file_get_contents() ($img_real). "" \r\n ".

    ' - ELOQUA_BOUNDARY - ';

    $headers = array ("Content-Length:".strlen ($data),"Content-Type: multipart/form-data;") Boundary = ELOQUA_BOUNDARY");

    $response = $eloquaRequest-> post (' assets/image/content', $data, $headers);

    ?>

    I have also adapted/reconstructed library Eloqua PHP in order to support the "BOLD" part. You must change the executeRequest function and add something like this to support change the request headers;

    curl_setopt ($this-> ch, CURLOPT_HTTPHEADER, $headers);

  • Updated filter shared via the REST API

    Hello I'm trying to update a shared API filter. I'm using PHP and client fredsakr/eloqua-php-application · GitHub.

    So far, I was able to retrieve the filter with the following call:

    <?php
    require('./eloquaRequest.php');
    $eloquaRequest = new EloquaRequest('site', 'User.Name', 'password', 'https://secure.eloqua.com/API/REST/1.0');
    $response = $eloquaRequest->get('assets/contact/filters?search=TheFilterName&depth=complete');
    print_r($response);
    ?>
    

    I can see the filter in the answer below:

    (
        [type] => ContactFilter
        [currentStatus] => Active
        [id] => 100761
        [createdAt] => 1380137168
        [createdBy] => 48
        [depth] => complete
        [folderId] => 1036
        [name] => TheFilterName
        [updatedAt] => 1383589417
        [updatedBy] => 48
        [count] => 254382
        [criteria] => Array
            (
                [0] => stdClass Object
                    (
                        [type] => ContactFieldCriterion
                        [id] => 1912
                        [condition] => stdClass Object
                            (
                                [type] => TextSetCondition
                                [operator] => in
                                [optionListId] => 193
                            )
    
                        [fieldId] => 100012
                    )
    
            )
    
        [lastCalculatedAt] => 1380137190
        [scope] => global
      statement] => 1912
    

    What I want to do is update that corresponds to the values of 'Compare the Contact fields' in the GUI Eloqua under Contact = > Shared Library = > Contact filters.

    Looks like he has the "[type] = ContactFieldCriterion" under the [criteria] field in the response.

    I'd get how this value in a call to REST, and also how I would update it.

    Please let me know if you need more details on this issue. Please help and thank you.

    After some research I found what I wanted to do has been updated the list of options for this filter. See http://topliners.eloqua.com/docs/DOC-3588 for documentation on the base object. But I had difficulty in updating an OptionList with the Rest API using PUT. If you can help, please visit http://topliners.eloqua.com/message/36739#36739 . Thank you.

  • Add a contact e-mail group via the Rest API

    Hello

    Is it possible to add a contact to a group of e-mail through the Rest API?

    I saw this article here http://topliners.eloqua.com/docs/DOC-3526 which shows that you can get a subscription email group contacts status, however it is not clear how actually to add a contact to a group of e-mail via the API.

    I tried to post data to ' data/contact / {id} / groups/email/subscription "but I get a response of"Method not allowed"API."

    If someone managed to achieve? If so, how?

    See you soon

    Hi David,

    The POST operation is not supported by this endpoint, but you can use PUT a method for updating subscriptions Contact:

    • PUT: / data/contact / {id} / email/group / {groupId} / subscription

    Where the request body contains an object of the subscription. Hope this helps and please let us know if you need more information.

    Thank you

    Fred

  • REST API - subscriptions Contact

    Hello

    I'm updating subscriptions contact using the REST API, but the documentation at http://topliners.eloqua.com/docs/DOC-3526 seems to be updated. The current lead for/data/contact / {contactId} / groups/email/subscription is different than the result of the documentation.

    Can someone explain to me how I should manage subscriptions? I use https://secure.eloqua.com/API/REST/2.0 as the API endpoint.

    Thank you

    Ronald

    Hi Ronald,.

    The current stable version of the REST API is 1.0. Please note that 2.0 is public, but it is subject to change, and so we do not recommend that the community uses this.

    About the management of subscriptions, we will add a post shortly to describe how to subscribe and unsubscribe Contacts using the Rest API.

    Hope this helps and please let us know if you need more information.

    Thank you

    Fred

  • Download Images in Eloqua via the REST API (via an API?)

    Hello community!

    We are interfacing content between a site CMS and Eloqua for custom content, so that we can deliver such content in emails and the landing pages effectively.

    We have an obligation to affix an image (such as an icon of great white game) overlay, a bit like this: http://u3.uicdn.net/372/cc7727211f2a7907850d2f844e707/diy-business-us/vi_video_content.jpg

    Unfortunately the CMS system he can not provide, we for some reason any.  And trying to superimpose the image in e-mails of Eloqua using CSS will result in inconsistent results between email clients, particularly mobile and so on...

    Our plan is so - to superimpose the image in our middleware software and then download the image to Eloqua, then use newly uploaded in the system.

    Is there a way we can download a picture of Eloqua via the REST API or any other API?

    Thank you

    Mark

    Hi Mark,

    Yes, you can use the Rest API to upload images to your installation of Eloqua. We will aim to provide documentation in the near future, but for now, we have an example of project available on Github to show how load images: Image of assistance

    Hope this helps and please let me know if you need more information.

    Thank you

    Fred

  • REST API updates

    I try to get the REST API of emails. I have the system of creating emails OK but when I try and update doing a query PUT with the ID of the email created in the URL and the ID in the JSON data (and noting of also changed) it blows upward with an internal server error.

    Any pointers people can give me?

    Hi Fred, I just went to get a few POST and PUT requests to see if I could spot anything and post it here.

    And this is now, works very well.

    * shrugs *.

    I'll keep an eye on it and post if I have more problems.

  • There the rest APIs to retrieve the metadata for entity for eloqua objects?

    There is a list of all the objects that are accessible by the REST for CRUD in this link: REST API - Documentation for kernel objects in the objects of the core section.

    For each of the objects listed in the objects of the core section are there is a metadata field in the Properties section.

    For example, for the purpose of the e-mail message, The REST API - to access Emails , under the Properties section, there entered corresponding to the fields of the object of the emails under the
    Name, Type, Description and validation topics.

    Is there a REST API to retrieve the same information, i.e. metadata field for an object programmatically eloqua?
    Otherwise, this is a serious obstacle to building systems that are the metadata engine and support for SOAP is removed...

    The closest to what you are looking for would be endpoints of assistance for a description of the fields. Example of /api/bulk/1.0/contact/fields

    {

    "items": [{}

    'name': "E-mail address",

    "internalName": "C_EmailAddress",

    'dataType': 'emailAddress;

    'hasReadOnlyConstraint': false,

    'hasNotNullConstraint': false,

    'hasUniquenessConstraint': true,

    'Déclaration': '{{Contact.Field (C_EmailAddress)}}.

    "uri": "/ contact/field/100001",

    "converted': ' / Date (-2208970800000) /"

    'updatedAt': ' / Date (-2208970800000) / ".

    },

    {

    'name': "First name",

    "internalName": "C_FirstName",

    'dataType': "string",.

    'hasReadOnlyConstraint': false,

    'hasNotNullConstraint': false,

    'hasUniquenessConstraint': false,

    'Déclaration': '{{Contact.Field (C_FirstName)}}.

    "uri": "/ contact/field/100002."

    "converted': ' / Date (-2208970800000) /"

    "updatedBy": "MgrzzzOracleCloudSupportP01E10",

    'updatedAt': ' / Date (1408993722380) / ".

    },.....

    If so, it will also include an element "defaultValue". How many characters you can store in a field (precision) is documented here: Type of data (data and Digital Formats). The same endpoint exist in bulk 2.0, and there are variants for the account fields and Objetpersonnalise. Another exists in the REST through Api/rest/2.0/assets/contact/fields?depth=complete... It does not include the declaration of ML, but there other useful information such as the type of default update and a flag 'isAccountLinkageField '.

    Similarly, if you describe a form via SOAP or REST, it also will give you the fields and their type.

    Kind regards

    Bojan

  • REST API: attribute converted

    I use the REST API to access emails, and I found that the converted attribute is not readable in a time string. Could someone tell me how to convert it into a time warp?
    An example is converted":"1410076908 ". How to convert this number strng in one hour?

    The time stamp is provided in the format of the time.  Please see this page for info on this format of time stamp: http://www.epochconverter.com

  • Can you double to sort your emails? I.e. by topic, date?

    I want to sort my email by topic first, then the subject group, sort by date. Is this possible?

    The backend supports secondary sorts and if you sort first on the date column, then on the column of the object, it should work. The problem is that there is no user interface useful for everything except painful and impossible.

    The TotalMessage extension implements a widgets click in the column of the object to allow quick access to the different threads, sorting, grouping, column management actions. You can easily see what kinds of primary and secondary are used, which are supported by the backend, which are custom columns (no available secondary sort) etc.

    http://totalmessage.mozdev.org/

  • C#, UCCX, Rest API, PUT (update a resource) and not taken media Type supported

    Hi, I'm developing an application to update the skills of resources with the REST API.

    I can get all the values I want to (GET), but when I try to update a resource using PUT, and then I get a "415 Unsupported Media Type" webException.

    I discovered that c# / UCCX works with demand. MediaType (instead of request. ContentType).

    I got this error when I tried to GET the data. He now works for the GET.

    But to PUT it, I got the error. Method is defined as SAID, MediaType = "application/xml".

    I tried to empty, ' text/xml '...

    Looked on the internet, Web sites, saying always specify ContentType/MediaType = "application/xml", I have already done.

    I also got the same error if I try an application COULD and without sending data.

    Thanks for your help!

    public string MakeRequest()
    {
    var request = (HttpWebRequest) WebRequest.Create (EndPoint);
    request. Credentials = new System.Net.NetworkCredential (login, password);
    request. Method = Method.ToString ();
    request. ContentLength = 0;
    request. Accept = ContentType;
    request. MediaType = ContentType;
                
    #region so PUT
    If (! string.) IsNullOrEmpty (PostData) & method == HttpVerb.PUT)
    {
    encoding of var = new UTF8Encoding();
    PostData = PostData.Replace ("\n", "");
    var bytes = Encoding.UTF8.GetBytes (PostData);
    request. ContentLength = bytes. Length;
                    
    using (var writeStream = request. GetRequestStream())
    {
    writeStream.Write (bytes, 0, bytes.) (Length);
    }
    }
    #endregion

    Try
    {
    assistance (response var = (HttpWebResponse) request. GetResponse())
    {
    var responseValue = string. Empty;

    If (answer. StatusCode! = HttpStatusCode.OK)
    {
    var message = String.Format ("request failed. Received HTTP {0}", response. StatusCode);
    throw new ApplicationException (message);
    }

    Enter the answer
    using (var responseStream = response. GetResponseStream())
    {
    If (responseStream! = null)
    using (var = new StreamReader (responseStream) Player)
    {
    responseValue = reader. ReadToEnd();
    }
    }

    Return responseValue;
    }
    }
    catch (WebException wex)
    {
    error string = wex. Message;
    Return ' ';
    }

    OK you got, in this case, post your request in the Sub forum as well which is sought after by developers and you can you expect a concrete answer/explanation on the same

    https://communities.Cisco.com/community/Developer/Express-configuration-API

    Concerning

    Deepak

  • CPO 3.0 call a REST API

    I try to call a remote REST API that returns a JSON object.

    The call browser API looks like this

    http://IPAM-dev/phpipam/API/?app_id=API&controller=sections&action=read&ID=6

    Returns

    {'success': true, 'data': {'id': '6', 'name': "Telford subnets", 'description': '',' masterSection': '0', 'permissions': "{\"4\":\"1\ ""} strictMode ',' ': '1', 'subnetOrdering': null, 'order': null, "editDate": null, "showVLAN": '0', 'showVRF': '0' "}}

    When I try to use the OPC Web HTTP Request activity it fails with the following error

    Unable to send a content-body with this type of verb.

    I think the problem here is the content type. The default is application/xml; charset = utf - 8 in the activity, I tried to change this text, html and json, but still did not work. I can't let the emty content type in the activity.

    Anyone have any suggestion how to make a REST of CPO call using the activity Web HTTP request

    Try to change GET to POST (in the form of CALL-CPO_REST - RQ.png).  Sends the contents of the body generally requires a POST not a GET.

Maybe you are looking for