Overview

Naytev separates Social Posts into two distinct concepts: Posts and Content. 

  • Content items are objects that represent an underlying resource that can be posted. For example, Links, Images and Videos are each types of Content. When you upload Content, a Content item is associated with a single social handle, and is automatically added to your Naytev Content Library (displayed in the main view of your Naytev dashboard). 
  • Posts are individual instances of a Content item being posted to a social network. A Post object contains all the details of the given post, including the scheduling options and creative details. By editing the fields of the post you can control the editorial fields including Message, Image, Headline, and Description. If you don't specify information for these variables, Naytev will publish the default Open Graph information for your content.  When creating a Post, you may specify an existing piece of Content for the post to be based on or define one inline as part of the same API request.

POST /v1/socialHandle/:socialHandleID/content

Description

  • Adds a piece of content to your Social Handle's content library.

Params

  • socialHandleID -The Social Handle ID as retrieved from the OrganizationAPI

Request Body

  • Link:
{
    type: "Link",
    url: String
}
  • Image:
{
    type: "Link",
    url: String,
    name: String
}

Response

200 - JSON Object: The newly created content will be returned in the response body. 

  • Link
{
    id: Number,
    type: "LinkContent",
    url: String,
    headline: String,
    imageUrl: String
}
  • Image
{
    id: Number,
    type: "ImageContent",
    url: String,
    name: String
}


DELETE /v1/socialHandle/:socialHandleID/content/:contentID

Description:

Removes a piece of content from the content library

Params:

  • socialHandleID - The Social Handle ID as retrieved from the OrganizationAPI
  • contentID - The Content ID

Request Body:
Empty Body

Response:
204 - NoContent

POST /v1/socialHandle/:socialHandleID/post

Description:

Creates a post that will be posted to your social handle. The post can be scheduled, posted intelligently, or posted immediately depending on your desired outcome.  The posts can either use an existing piece of content or can manually specify the content. If you manually specify the content, it is effectively the same as creating the content first, then running a post of that content.

Params:

  • socialHandleID -The Social Handle ID as retrieved from the OrganizationAPI

Post Data:

  • Facebook Link Post
{
    type: "FacebookLinkPost",
    message: String,
    imageURL: String,
    headline: String,
    description: String
    options: {
        type: PostOptimizedType
        onHold: Boolean // Not Required, default false
    }
    // Either contentID or new inline content
    contentID: Long // Option 1
    content: { // Option 2
        type: "LinkContent",
        url: String
    }
}
  • Facebook Image Post
{
    type: "FacebookImagePost",
    message: String,
    options: {
        type: PostOptimizedType
        onHold: Boolean // Not Required, default false
    }
    // Either contentID or new inline content
    contentID: Long // Option 1
    content: { // Option 2
        type: "ImageContent",
        url: String,
        name: String
    }
}

Post Types:

There are four types of posts supported through the Naytev API:

  • FacebookLinkPost
  • FacebookImagePost
  • TwitterLinkPost
  • TwitterImagePost

Each post type has unique parameters, which are required and merged with other common parameters:

  • FacebookLinkPost
{
    message: String,
    imageURL: String,
    headline: String,
    description: String,
    link: String
}

Note: "link" parameter above must point to a page that has an og:url value that matches the url field in the content. If you want to add custom tracking parameters or short links, please specify them in the link parameter. The link parameter you specify is what will ultimately be posted.

  • FacebookImagePost
{
    message: String
}

  • TwitterLinkPost
{
    message: String
}

note: You must include the link in the message. Due to the nature of a tweet and it's ability to have the link in any part of the tweet, it is required to add the link to the message.

  • TwitterImagePost
{
    message: String
}

Post Options:

The options parameter of the Post controls when the post should go out. The post options must have one of the following values:

  • PostOptimized - Naytev Advanced Scheduler will intelligently schedule the post to be shared at an optimal time identified by Naytev.
  • PostExactTime - The post will be shared at the specified time. The time parameter is required with this option. 
  • PostImmediately - The post will be shared now.
  • PostOptimizedASAP - Post will get scheduled at the next available unlocked timeslot.
  • PostOptimizedTimeFrame - Naytev Advanced Scheduler will schedule the post between the times specified.

For PostExactTime there is an extra parameter required

{
  time: DateTime
}

note: the DateTime is the Unix epoch format. The number milliseconds since epoch. 

For PostOptimizedTimeFrame there is an extra parameter required

{
  timeRange: {
    startTime: DateTime,
    endTime: DateTime
  }
}

note: the DateTime is the Unix epoch format. The number milliseconds since epoch. 

There is one other options that can be paired with the with the post options:

  • onHold -- If true, the post will not go out until a user takes the post out of hold.

Response:

200 - JSON Object
The newly created post object will be returned in the response body.
Example FacebookLinkPost Response:

{
    id: Number,
    type: "FacebookLinkPost",
    options: {
        type: PostOption,
        onHold: Boolean
    },
    content: {
        id: Number,
        type: "Link",
        ogUrl: String,
        headline: String,
        imageUrl: String
    },
    message: String,
    imageURL: String,
    headline: String,
    description: String,
    link: String
}

PATCH /v1/post/:postID

Description:

Modifies an existing post, modifying the creative or the posting options of the post. You are not able to change the underlying content of the post. If you would like to change the content, please delete the existing post and recreate a post with the proper content. You specify all the fields as there is no partial overwrite.

Params:

  • postID - The id returned from the Post Endpoint.

Post Data:

The post data is mostly the same as you used to create the post originally. Content and contentID will be ignored and will used the existing content object when the post was created.

Response:

200 - JSON Object
The updated Post object

Example FacebookLinkPost Response:

{
    id: Number,
    type: "FacebookLinkPost",
    options: {
        type: PostOption,
        onHold: Boolean
    },
    content: {
        id: Number,
        type: "Link",
        url: String,
        headline: String,
        imageUrl: String
    },
    message: String,
    imageURL: String,
    headline: String,
    description: String,
    link: String
}

DELETE /v1/post/:postID

Description

Delete an existing post. This will remove it from the scheduler and will ensure it doesn't get posted to your social Handle.

Params

  • postID - The id returned from the Post Endpoint.

Response:

204 - No Content

Did this answer your question?