Links
- XML structure for material
- XML structure for other resources - search, pressroom_info
- List of our categories
Introduction
Mynewsdesk Webservice for newsroom is a way for you, as a registered customer, to fetch information from your newsroom at Mynewsdesk to any system. You can get all your information as XML and create email subscriptions to your material.
The webservice is built around simple GET/POST requests over HTTP, to keep it simple to implement and be as platform independent as possible. Your response will be XML and HTTP status codes.
Before you can use the service, you need to have it activated by us and receive your unique key. The key is used in all requests for authentication.
http://www.mynewsdesk.com/services/pressroom/service/unique key/?parameter=value¶meter=value
The URL pattern above is used for all services. The name of each of the services, and their parameters are listed below.
Services
This is a list of the features available in the latest version of Webservice for pressroom.
- list - List material
- view - View single material
- search - Search material
- subscribe - Create subscription
- send_email - Send material as email
- pressroom_info - View pressroom information
- create_comment - Create comment
list - List material
http://www.mynewsdesk.com/services/pressroom/list/unique key/?[type_of_media=pressrelease|news|blog_post|event|image|video|document|contact_person]&[limit=limit]&[offset=offset]&[order=published|updated|created]&[format=xml|rss|json]
Accepts
HTTP GET request.
Returns
XML or RSS over HTTP. Status code "200 OK" on successful request. Status code "404 Not Found" if no material was found. The result is returned as RSS if "format=rss" is specified, or as JSON if "format=json" is specified.
Optional parameters
-
type_of_media (Default: pressrelease)
Fetch material of this type only.
-
limit (Default: 20)
Set the maximum number of items in the response. This cannot be more than 100.
-
offset (Default: 0)
Specify which item (sequentially) should be first, skipping preceding items.
-
order (Default: published for pressreleases, news and blog posts. Start date for events. Position for images, videos, documents and contact people)
Specify the sort order of the result: publish date (published), latest update (updated) or creation date (created).
-
format (Default: xml)
Specify the format of the response: RSS 2.0, JSON or full XML.
-
callback
If format is JSON and callback is specified, the JSON response is wrapped in a function call with the specified callback name.
-
pressroom (Default: all)
Set the pressroom to fetch material from. Examples: 'se' – Swedish pressroom, 'uk' – United Kingdom pressroom.
-
archived (Default: false)
Fetch items marked as archived, this is useful for fetching old events. Example: 'true' – Fetches all the items, including archived ones.
view - View single material
http://www.mynewsdesk.com/services/pressroom/view/unique key/?[item_id=id]&[type_of_media=pressrelease|news|blog_post|event|image|video|document|contact_person]
Accepts
HTTP GET request.
Returns
XML over HTTP. Status code "200 OK" on successful request. Status code "404 Not Found" if no material was found. Format is JSON or XML.
Required parameters
-
item_id
ID of the material to be fetched.
Optional parameters
-
type_of_media (Default: pressrelease)
The type of material to be fetched.
-
format (Default: xml)
Specify the format of the response: JSON or full XML.
-
callback
If format is JSON and callback is specified, the JSON response is wrapped in a function call with the specified callback name.
search - Search material
http://www.mynewsdesk.com/services/pressroom/search/unique key/?[query=query]&[type_of_media=pressrelease|news|blog_post|event|image|video|document|contact_person]&[limit=limit]&[page=page]&[date_mode=between|on|before|after]&[date_start=date]&[date_end=date]&[date_on=date]&[format=xml|rss|json]
Accepts
HTTP GET request.
Returns
XML or RSS over HTTP. Status code "200 OK" on successful request. The result is returned as RSS if "format=rss" is specified, or as JSON if "format=json" is specified.
Optional parameters
-
query
Search string. The search is performed on all text fields in the material, like the header, summary and body. Searching supports advanced queries with AND/OR/NOT, and wildcards (*).
-
type_of_media (Default: pressrelease)
The type of material to be fetched.
-
limit (Default: 20)
Set the maximum number of items in the response. This cannot be more than 100.
-
page (Default: 1)
Page number in the search result
-
format (Default: xml)
Specify the format of the response: RSS 2.0, JSON or full XML.
-
callback
If format is JSON and callback is specified, the JSON response is wrapped in a function call with the specified callback name.
-
pressroom (Default: all)
Set the pressroom to search in. 'se' – Swedish pressroom, 'no' – Norwegian pressroom
-
date_mode
Specifies how the date parameters are used. Valid values are: "between", "on", "before" or "after".
-
date_start
Start date. Valid only with date modes "between" and "after". Format: YYYY-MM-DD, e.g. "2006-12-31".
-
date_end
End date. Valid only with date modes "between" and "before". Format: YYYY-MM-DD, e.g. "2006-12-31".
-
date_on
Date. Valid only with date mode "on". Format: YYYY-MM-DD, e.g. "2006-12-31".
subscribe - Create subscription
http://www.mynewsdesk.com/services/pressroom/subscribe/unique key/?[newsdesk_subscriber_email=email-address]&[newsdesk_subscribe_to_[pressreleases|news|blog_posts|events|images|videos|documents|contact_people]=1]
Accepts
HTTP POST request.
Returns
Status code "200 OK" on successful request. Status code "422 Unprocessable Entity" if the subscription could not be created.
Required parameters
-
newsdesk_subscriber_email
Email address of the subscriber.
-
newsdesk_subscribe_to_type
Send a parameter with the value 1 for each type of material to be included in the subscription. At least one type is required.
Optional parameters
-
newsdesk_pressroom (Default: Your first pressroom)
Set the pressroom to search in. 'se' – Swedish pressroom, 'no' – Norwegian pressroom and 'en' for international pressroom.
send_email - Send material as email
http://www.mynewsdesk.com/services/pressroom/send_email/unique key
Accepts
HTTP POST request.
Returns
Status code "200 OK" on successful request. Status code "422 Unprocessable Entity" on invalid request.
Required parameters
-
item_id
ID of the material to be fetched.
-
to_email
Recipient email address.
Optional parameters
-
type_of_media (Default: pressrelease)
The type of material to be fetched. Valid values are "pressrelease", "news", "blog_post","event", "image", "video", "document" and "contact_person".
-
from
Name of sender.
-
message
Personal message from the sender to the recipient.
This method sends an email message to the recipient, with a link to the material and an optional message from the sender.
pressroom_info - View pressroom information
http://www.mynewsdesk.com/services/pressroom/pressroom_info/unique key?[pressroom=se|no|en]
Accepts
HTTP GET request.
Returns
Status code "200 OK" on successful request. Status code "404 Not Found" if no pressroom was found.
Optional parameters
-
pressroom (Default: Your first pressroom)
Set the pressroom to search in. 'se' – Swedish pressroom, 'no' – Norwegian pressroom and 'en' for international pressroom.
The XML returned includes a tag cloud, pressroom description, press contacts etc - as on your pressroom on www.mynewsdesk.com.
A "tag cloud" is a visual representation of the frequency of tags in your pressroom, on a scale from 1-5. More popular tags are displayed in a larger font.
create_comment - Create comment
http://www.mynewsdesk.com/services/pressroom/create_comment/unique key
Accepts
HTTP POST request.
Returns
Status code "200 OK" on successful request. Status code "422 Unprocessable Entity" if comment could not be created.
Required parameters
-
commentable_id
ID of the material that is commented.
-
type_of_media
Type of material. Valid values are "pressrelease", "news", "blog_post", "event", "image", "video", "document" and "contact_person".
-
name
Name of commenter.
-
body
Content of comment.
-
email
Email address of commenter.
-
user_ip
IP number of commenter. This is needed for easier moderation and spam protection.
Optional parameters
-
blog
URL of commenter's blog/website.